Skip to content

Commit eb84b8f

Browse files
authored
Add /usr/local/bin to command path by default in unix (#4625)
1 parent 87efb51 commit eb84b8f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Utils/azuretools-core/src/com/microsoft/azuretools/utils/CommandUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public static String exec(final String commandWithArgs) throws IOException {
8383
logger.throwing(CommandUtils.class.getName(), "exec", exception);
8484
throw exception;
8585
}
86-
return executeCommandAndGetOutput(starter, switcher, commandWithArgs, new File(workingDirectory));
86+
final String commandWithPath = isWindows() ? commandWithArgs : String.format("export PATH=$PATH:/usr/local/bin ; %s", commandWithArgs);
87+
return executeCommandAndGetOutput(starter, switcher, commandWithPath, new File(workingDirectory));
8788
}
8889

8990
public static String executeCommandAndGetOutput(final String commandWithoutArgs, final String[] args, final File directory) throws IOException {

0 commit comments

Comments
 (0)