Setting CYGWIN=nodosfilewarning env variable on windows

This commit is contained in:
Federico Fissore 2014-04-28 13:21:56 +02:00 committed by Cristian Maglie
parent 44a6cbf2de
commit fdffb2de26
1 changed files with 8 additions and 3 deletions

View File

@ -1,9 +1,10 @@
package processing.app.helpers; package processing.app.helpers;
import java.io.IOException;
import processing.app.Base; import processing.app.Base;
import java.io.IOException;
import java.util.Map;
public class ProcessUtils { public class ProcessUtils {
public static Process exec(String[] command) throws IOException { public static Process exec(String[] command) throws IOException {
@ -20,6 +21,10 @@ public class ProcessUtils {
String[] cmdLine = new String[command.length]; String[] cmdLine = new String[command.length];
for (int i = 0; i < command.length; i++) for (int i = 0; i < command.length; i++)
cmdLine[i] = command[i].replace("\"", "\\\""); cmdLine[i] = command[i].replace("\"", "\\\"");
return Runtime.getRuntime().exec(cmdLine);
ProcessBuilder pb = new ProcessBuilder(cmdLine);
Map<String, String> env = pb.environment();
env.put("CYGWIN", "nodosfilewarning");
return pb.start();
} }
} }