Latest YarnRunner fails on Windows
MikeSuiter opened this issue · 3 comments
MikeSuiter commented
This fix worked for me on Windows.
private ProcessExecutor command(String... cmd) {
if (isWindows()) {
List<String> args = new ArrayList<>(Arrays.asList("cmd", "/c"));
args.addAll(Arrays.asList(cmd));
return new ProcessExecutor().command(args);
}
return new ProcessExecutor().command(Arrays.asList(cmd));
}
geowarin commented
Whoops sorry! Forgot about Array.asList returning an immutable list!
geowarin commented
That being said the code is really ugly, any way to make it better ?
MikeSuiter commented
This might be a little cleaner and seems to work on Windows.
private ProcessExecutor command(String... cmd) {
List<String> args = new ArrayList<>(Arrays.asList(cmd));
if (isWindows()) {
args.addAll(0, Arrays.asList("cmd", "/c"));
}
return new ProcessExecutor().command(args);
}