JAL-3285 add Cygwin environment path fix for Windows
authortva <tva@10.205.251.175>
Thu, 6 Jun 2019 13:08:58 +0000 (14:08 +0100)
committertva <tva@10.205.251.175>
Thu, 6 Jun 2019 13:08:58 +0000 (14:08 +0100)
src/jalview/hmmer/HmmerCommand.java

index b5c1b25..73995af 100644 (file)
@@ -112,6 +112,12 @@ public abstract class HmmerCommand implements Runnable
     {
       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()
       {
@@ -168,6 +174,7 @@ public abstract class HmmerCommand implements Runnable
     }
 
     List<String> wrapped = new ArrayList<>();
+    // wrapped.add("C:\Users\tva\run");
     wrapped.add(bash.getAbsolutePath());
     wrapped.add("-c");