Skip to content

Commit

Permalink
Merge pull request #434 from Antibrumm/master
Browse files Browse the repository at this point in the history
Use InstallDirectory to locate node tasks instead of the WorkingDirectory
  • Loading branch information
eirslett committed Feb 28, 2017
2 parents e568deb + 3ebc007 commit db2e984
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Expand Up @@ -5,6 +5,7 @@
public interface NodeExecutorConfig {
File getNodePath();
File getNpmPath();
File getInstallDirectory();
File getWorkingDirectory();
Platform getPlatform();
}
Expand Down Expand Up @@ -32,7 +33,11 @@ public File getNpmPath() {
return new File(installConfig.getInstallDirectory() + Utils.normalize(NPM));
}


@Override
public File getInstallDirectory() {
return installConfig.getInstallDirectory();
}

@Override
public File getWorkingDirectory() {
return installConfig.getWorkingDirectory();
Expand Down
Expand Up @@ -67,7 +67,11 @@ public final void execute(String args, Map<String, String> environment) throws T
private String getAbsoluteTaskLocation() {
String location = normalize(taskLocation);
if (Utils.isRelative(taskLocation)) {
location = new File(config.getWorkingDirectory(), location).getAbsolutePath();
File taskFile = new File(config.getWorkingDirectory(), location);
if (!taskFile.exists()) {
taskFile = new File(config.getInstallDirectory(), location);
}
location = taskFile.getAbsolutePath();
}
return location;
}
Expand Down

0 comments on commit db2e984

Please sign in to comment.