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

Commit 79de63c

Browse files
authored
Merge pull request #204 from mathworks/gecko_g2630833
Fix for MATLAB root path displayed in Jenkins build logs.
2 parents fab4660 + 0c12d73 commit 79de63c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher
182182
setEnv(initialEnvironment);
183183

184184
FilePath matlabExecutablePath = new FilePath(launcher.getChannel(),
185-
getNodeSpecificMatlab(Computer.currentComputer(), listener) + "/bin/" + getNodeSpecificExecutable(launcher));
185+
getNodeSpecificMatlab(Computer.currentComputer(), listener) + getNodeSpecificExecutable(launcher));
186186

187187
if (!matlabExecutablePath.exists()) {
188188
throw new MatlabNotFoundError(Message.getValue("matlab.not.found.error"));
@@ -196,6 +196,6 @@ public void setUp(Context context, Run<?, ?> build, FilePath workspace, Launcher
196196
}
197197

198198
private String getNodeSpecificExecutable(Launcher launcher) {
199-
return (launcher.isUnix()) ? "matlab" : "matlab.exe";
199+
return (launcher.isUnix()) ? "/bin/matlab" : "\\bin\\matlab.exe";
200200
}
201201
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ public static void addMatlabToEnvPathFrmAxis(Computer cmp, TaskListener listener
4545
}
4646

4747
String matlabExecutablePath = getNodeSpecificHome(name,
48-
cmp.getNode(), listener, env) + "/bin";
48+
cmp.getNode(), listener, env) + ((Boolean.TRUE.equals(cmp.isUnix()))?"/bin" : "\\bin");
4949
env.put("PATH+matlabroot", matlabExecutablePath);
50+
5051
// Specify which MATLAB was added to path.
5152
listener.getLogger().println("\n" + String.format(Message.getValue("matlab.added.to.path.from"), matlabExecutablePath) + "\n");
5253
}

0 commit comments

Comments
 (0)