util: allow to overwrite "PWD" in "Environment Variables" dialog like it's possible...
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Sat, 8 Oct 2016 10:16:51 +0000 (13:16 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Sat, 8 Oct 2016 10:16:51 +0000 (13:16 +0300)
platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java

index d935edfba49260358c51a6e27ab9c95887b384ba..eb767b601988531ef69f75398694b3d741045463 100644 (file)
@@ -386,6 +386,13 @@ public class GeneralCommandLine implements UserDataHolder {
       environment.putAll(getParentEnvironment());
     }
 
+    if (SystemInfo.isUnix) {
+      File workDirectory = getWorkDirectory();
+      if (workDirectory != null) {
+        environment.put("PWD", FileUtil.toSystemDependentName(workDirectory.getAbsolutePath()));
+      }
+    }
+
     if (!myEnvParams.isEmpty()) {
       if (SystemInfo.isWindows) {
         THashMap<String, String> envVars = new THashMap<>(CaseInsensitiveStringHashingStrategy.INSTANCE);
@@ -398,13 +405,6 @@ public class GeneralCommandLine implements UserDataHolder {
         environment.putAll(myEnvParams);
       }
     }
-
-    if (SystemInfo.isUnix) {
-      File workDirectory = getWorkDirectory();
-      if (workDirectory != null) {
-        environment.put("PWD", FileUtil.toSystemDependentName(workDirectory.getAbsolutePath()));
-      }
-    }
   }
 
   /**