Skip to content

Commit 48bf883

Browse files
author
Paul Verest
committed
DONE propagate workdir changes to .phantom,.mongo ...
1 parent bea7de5 commit 48bf883

5 files changed

Lines changed: 25 additions & 29 deletions

File tree

org.nodeclipse.debug/src/org/nodeclipse/debug/launch/LaunchConfigurationDelegate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void launch(ILaunchConfiguration configuration, String mode,
199199
}
200200

201201
//TODO rename workingPath to workingDirectory, workingDirectory to workingDirectoryConfig
202-
//TODO propagate changes to .phantom,.mongo ...
202+
//DONE propagate changes to .phantom,.mongo ...
203203
File workingPath = null;
204204
String workingDirectory = configuration.getAttribute(Constants.ATTR_WORKING_DIRECTORY, "");
205205
if(workingDirectory.length() > 0) {

org.nodeclipse.jjs/src/org/nodeclipse/jjs/launch/LaunchConfigurationDelegate.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,17 @@ public void launch(ILaunchConfiguration configuration, String mode,
6969
// path is relative, so cannot find it, unless get absolute path
7070
cmdLine.add(filePath);
7171

72-
String workingDirectory = configuration.getAttribute(Constants.ATTR_WORKING_DIRECTORY, "");
7372
File workingPath = null;
74-
if(workingDirectory.length() == 0) {
75-
workingPath = (new File(filePath)).getParentFile();
76-
} else {
73+
String workingDirectory = configuration.getAttribute(Constants.ATTR_WORKING_DIRECTORY, "");
74+
if(workingDirectory.length() > 0) {
7775
workingDirectory = VariablesUtil.resolveValue(workingDirectory);
78-
if(workingDirectory == null) {
79-
workingPath = (new File(filePath)).getParentFile();
80-
} else {
76+
if(workingDirectory != null) {
8177
workingPath = new File(workingDirectory);
8278
}
8379
}
80+
if (workingPath == null){
81+
workingPath = (new File(filePath)).getParentFile();
82+
}
8483

8584
Map<String, String> envm = new HashMap<String, String>();
8685
envm = configuration.getAttribute(Constants.ATTR_ENVIRONMENT_VARIABLES, envm);

org.nodeclipse.mongodb/src/org/nodeclipse/mongodb/launch/LaunchConfigurationDelegate.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,17 @@ public void launch(ILaunchConfiguration configuration, String mode,
7272
// path is relative, so cannot find it, unless get absolute path
7373
cmdLine.add(filePath);
7474

75-
String workingDirectory = configuration.getAttribute(Constants.ATTR_WORKING_DIRECTORY, "");
7675
File workingPath = null;
77-
if(workingDirectory.length() == 0) {
78-
workingPath = (new File(filePath)).getParentFile();
79-
} else {
76+
String workingDirectory = configuration.getAttribute(Constants.ATTR_WORKING_DIRECTORY, "");
77+
if(workingDirectory.length() > 0) {
8078
workingDirectory = VariablesUtil.resolveValue(workingDirectory);
81-
if(workingDirectory == null) {
82-
workingPath = (new File(filePath)).getParentFile();
83-
} else {
79+
if(workingDirectory != null) {
8480
workingPath = new File(workingDirectory);
8581
}
8682
}
83+
if (workingPath == null){
84+
workingPath = (new File(filePath)).getParentFile();
85+
}
8786

8887
Map<String, String> envm = new HashMap<String, String>();
8988
envm = configuration.getAttribute(Constants.ATTR_ENVIRONMENT_VARIABLES, envm);

org.nodeclipse.phantomjs/src/org/nodeclipse/phantomjs/launch/LaunchConfigurationDelegate.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,17 @@ public void launch(ILaunchConfiguration configuration, String mode,
8282
// path is relative, so cannot find it, unless get absolute path
8383
cmdLine.add(filePath);
8484

85-
String workingDirectory = configuration.getAttribute(Constants.ATTR_WORKING_DIRECTORY, "");
8685
File workingPath = null;
87-
if(workingDirectory.length() == 0) {
88-
workingPath = (new File(filePath)).getParentFile();
89-
} else {
86+
String workingDirectory = configuration.getAttribute(Constants.ATTR_WORKING_DIRECTORY, "");
87+
if(workingDirectory.length() > 0) {
9088
workingDirectory = VariablesUtil.resolveValue(workingDirectory);
91-
if(workingDirectory == null) {
92-
workingPath = (new File(filePath)).getParentFile();
93-
} else {
89+
if(workingDirectory != null) {
9490
workingPath = new File(workingDirectory);
9591
}
9692
}
93+
if (workingPath == null){
94+
workingPath = (new File(filePath)).getParentFile();
95+
}
9796

9897
Map<String, String> envm = new HashMap<String, String>();
9998
envm = configuration.getAttribute(Constants.ATTR_ENVIRONMENT_VARIABLES, envm);

org.nodeclipse.vertx/src/org/nodeclipse/vertx/launch/LaunchConfigurationDelegate.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,17 @@ public void launch(ILaunchConfiguration configuration, String mode,
6565
// path is relative, so cannot find it, unless get absolute path
6666
cmdLine.add(filePath);
6767

68-
String workingDirectory = configuration.getAttribute(Constants.ATTR_WORKING_DIRECTORY, "");
6968
File workingPath = null;
70-
if(workingDirectory.length() == 0) {
71-
workingPath = (new File(filePath)).getParentFile();
72-
} else {
69+
String workingDirectory = configuration.getAttribute(Constants.ATTR_WORKING_DIRECTORY, "");
70+
if(workingDirectory.length() > 0) {
7371
workingDirectory = VariablesUtil.resolveValue(workingDirectory);
74-
if(workingDirectory == null) {
75-
workingPath = (new File(filePath)).getParentFile();
76-
} else {
72+
if(workingDirectory != null) {
7773
workingPath = new File(workingDirectory);
7874
}
7975
}
76+
if (workingPath == null){
77+
workingPath = (new File(filePath)).getParentFile();
78+
}
8079

8180
//env
8281
String[] envp = getEnvironmentVariables(configuration);

0 commit comments

Comments
 (0)