mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed parent parameters inlining for environment variables
This commit is contained in:
@@ -339,12 +339,15 @@ public class EnvironmentUtil {
|
||||
}
|
||||
|
||||
public static void inlineParentOccurrences(@NotNull Map<String, String> envs) {
|
||||
Map<String, String> parentParams = new HashMap<String, String>(System.getenv());
|
||||
inlineParentOccurrences(envs, new HashMap<String, String>(System.getenv()));
|
||||
}
|
||||
|
||||
public static void inlineParentOccurrences(@NotNull Map<String, String> envs, @NotNull Map<String, String> parentEnv) {
|
||||
for (Map.Entry<String, String> entry : envs.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
if (value != null) {
|
||||
String parentVal = parentParams.get(key);
|
||||
String parentVal = parentEnv.get(key);
|
||||
if (parentVal != null && containsEnvKeySubstitution(key, value)) {
|
||||
envs.put(key, value.replace("$" + key + "$", parentVal));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user