Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
nqp::openpipe handling for Windows.
  • Loading branch information
jnthn committed Sep 25, 2013
1 parent a47a76b commit b591400
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/vm/jvm/runtime/org/perl6/nqp/io/ProcessHandle.java
Expand Up @@ -21,7 +21,13 @@ public class ProcessHandle extends SyncHandle {
Process process;

public ProcessHandle(ThreadContext tc, String cmd, String dir, Map<String, String> env) {
ProcessBuilder pb = new ProcessBuilder("sh", "-c", cmd);
ProcessBuilder pb;
String os = System.getProperty("os.name").toLowerCase();
if (os.indexOf("win") >= 0) {
pb = new ProcessBuilder("cmd", "/c", cmd.replace('/', '\\'));
} else {
pb = new ProcessBuilder("sh", "-c", cmd);
}
pb.directory(new File(dir));
pb.redirectErrorStream(true);

Expand Down

0 comments on commit b591400

Please sign in to comment.