Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit fbb611e

Browse files
committed
Fixed issue378
1 parent 8586774 commit fbb611e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/com/mathworks/ci/MatlabInstallation.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import hudson.CopyOnWrite;
1111
import hudson.EnvVars;
1212
import hudson.Extension;
13+
import hudson.FilePath;
1314
import hudson.Util;
1415
import hudson.model.EnvironmentSpecific;
1516
import hudson.model.Node;
@@ -18,7 +19,10 @@
1819
import hudson.tools.ToolDescriptor;
1920
import hudson.tools.ToolInstallation;
2021
import hudson.tools.ToolProperty;
22+
import java.io.File;
2123
import java.io.IOException;
24+
import java.nio.file.Path;
25+
import java.nio.file.Paths;
2226
import java.util.Arrays;
2327
import java.util.List;
2428
import javax.annotation.CheckForNull;
@@ -57,8 +61,11 @@ public MatlabInstallation forNode(@Nonnull Node node, TaskListener log) throws I
5761

5862
@Override
5963
public void buildEnvVars(EnvVars env) {
64+
FilePath batchExecutablePath = new FilePath (Jenkins.get().getChannel(), getHome());
6065
String pathToExecutable = getHome() + "/bin";
61-
env.put ("PATH+matlab_batch", getHome ());
66+
if( batchExecutablePath.getParent () != null ){
67+
env.put ("PATH+matlab_batch", batchExecutablePath.getParent().getRemote());
68+
}
6269
env.put("PATH+matlabroot", pathToExecutable);
6370
}
6471

0 commit comments

Comments
 (0)