ProcessUtil.extraPath now works for non-windows systems.

This commit is contained in:
Ned Twigg 2017-11-22 17:49:44 -08:00
parent 12023b35df
commit 06fd94374c
2 changed files with 5 additions and 4 deletions

View File

@ -154,7 +154,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
<version>3.7</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>

View File

@ -180,15 +180,16 @@ public class ProcessUtil {
} else {
cmd = new String[] { "cmd", "/c", command };
}
cmd = ArrayUtils.addAll(cmd, args);
} else {
if (nodeCommands.contains(command)) {
cmd = new String[] { getNpmPath(command) };
cmd = ArrayUtils.addAll(cmd, args);
} else {
cmd = new String[] { command };
String cmdAndArgs = StringUtils.join(ArrayUtils.insert(0, args, command), " ");
cmd = new String[] { "/bin/sh", "-c", cmdAndArgs };
}
}
cmd = ArrayUtils.addAll(cmd, args);
logger.debug("run command: " + StringUtils.join(cmd, " "));
Process[] process = { null };
try {