Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,9 @@ public static Map<String, String> getSystemEnv()
env.put(IDFCorePreferenceConstants.IDF_TOOLS_PATH, idfToolsPath);

// Merge Homebrew bin paths into PATH
String existingPath = env.getOrDefault("PATH", ""); //$NON-NLS-1$ //$NON-NLS-2$
// Windows may use "Path" while Unix uses "PATH"
String keyPath = env.containsKey("PATH") ? "PATH" : "Path"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String existingPath = env.getOrDefault(keyPath, ""); //$NON-NLS-1$
StringBuilder newPath = new StringBuilder();

String[] brewPaths = { "/usr/local/bin", "/opt/homebrew/bin" }; //$NON-NLS-1$ //$NON-NLS-2$
Expand All @@ -915,7 +917,7 @@ public static Map<String, String> getSystemEnv()

// Append the original PATH at the end
newPath.append(existingPath);
env.put("PATH", newPath.toString()); //$NON-NLS-1$
env.put(keyPath, newPath.toString()); // $NON-NLS-1$

return env;
}
Expand Down
Loading