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

Commit 1cbb9c6

Browse files
chmod after copying matlab-batch (#396)
1 parent 7afc938 commit 1cbb9c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/com/mathworks/ci/tools/MatlabInstaller.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,16 @@ public FilePath performInstallation(ToolInstallation tool, Node node, TaskListen
9292

9393
// Download mpm and matlab-batch to temp directory
9494
FilePath mpm = fetchMpm(platform, tempDir);
95-
FilePath matlabBatch = fetchMatlabBatch(platform, tempDir);
95+
FilePath tempMatlabBatch = fetchMatlabBatch(platform, tempDir);
9696

9797
// Install with mpm
9898
mpmInstall(mpm, release, this.getProducts(), matlabRoot, node, log);
9999

100100
// Copy downloaded matlab-batch to tool directory
101101
FilePath matlabBin = new FilePath(matlabRoot, "bin");
102-
matlabBatch.copyTo(new FilePath(matlabBin, "matlab-batch" + extension));
102+
FilePath matlabBatchBin = new FilePath(matlabBin, "matlab-batch" + extension);
103+
tempMatlabBatch.copyTo(matlabBatchBin);
104+
matlabBatchBin.chmod(0777);
103105

104106
// Delete temp directory
105107
tempDir.deleteRecursive();
@@ -225,7 +227,6 @@ private FilePath fetchMatlabBatch(String platform, FilePath destination)
225227
FilePath matlabBatchPath = new FilePath(destination, "matlab-batch" + extension);
226228
try {
227229
matlabBatchPath.copyFrom(matlabBatchUrl.openStream());
228-
matlabBatchPath.chmod(0777);
229230
} catch (IOException | InterruptedException e) {
230231
throw new InstallationFailedException("Unable to setup matlab-batch.");
231232
}

0 commit comments

Comments
 (0)