{
ProcessBuilder pb = new ProcessBuilder(args);
pb.redirectErrorStream(true); // merge syserr to sysout
+ if (Platform.isWindows())
+ {
+ String path = pb.environment().get("Path");
+ path = jalview.bin.Cache.getProperty("CYGWIN_PATH") + ";" + path;
+ pb.environment().put("Path", path);
+ }
final Process p = pb.start();
new Thread(new Runnable()
{
}
List<String> wrapped = new ArrayList<>();
+ // wrapped.add("C:\Users\tva\run");
wrapped.add(bash.getAbsolutePath());
wrapped.add("-c");
* @return
* @throws IOException
*/
- protected String getCommandPath(String cmd) throws IOException
+ protected String getCommandPath(String cmd)
+ throws IOException
{
String binariesFolder = Cache.getProperty(Preferences.HMMER_PATH);
// ensure any symlink to the directory is resolved:
.formatMessage("label.executable_not_found", cmd));
}
- return file == null ? null : getFilePath(file);
+ return file == null ? null : getFilePath(file, true);
}
/**
* X with /cygdrive/x.
*
* @param resultFile
+ * @param isInCygwin
+ * True if file is to be read/written from within the Cygwin
+ * shell. Should be false for any imports.
* @return
*/
- protected String getFilePath(File resultFile)
+ protected String getFilePath(File resultFile, boolean isInCygwin)
{
String path = resultFile.getAbsolutePath();
- if (Platform.isWindows())
+ if (Platform.isWindows() && isInCygwin)
{
// the first backslash escapes '\' for the regular expression argument
path = path.replaceAll("\\" + File.separator, "/");