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

Commit b8a2888

Browse files
committed
Create workspace folder if it does not exist.
1 parent 135e56c commit b8a2888

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/com/mathworks/ci/utilities/MatlabCommandRunner.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ public MatlabCommandRunner(MatlabActionParameters params) throws IOException, In
3636
this.params = params;
3737
this.additionalEnvVars = new HashMap<String,String>();
3838

39+
// Handle case where workspace doesn't exist
40+
if (!params.getWorkspace().exists()) {
41+
params.getWorkspace().mkdirs();
42+
}
43+
3944
// Create MATLAB folder
4045
FilePath matlabFolder = new FilePath(
4146
params.getLauncher().getChannel(), params.getWorkspace().getRemote()

src/test/java/unit/com/mathworks/ci/utilities/MatlabCommandRunnerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void validConstructorDoesNotThrow() throws IOException, InterruptedExcept
8888
public void constructorUsesParamsForTempFolder() throws IOException, InterruptedException {
8989
MatlabCommandRunner runner = new MatlabCommandRunner(params);
9090
verify(params, times(1)).getLauncher();
91-
verify(params, times(1)).getWorkspace();
91+
verify(params, times(3)).getWorkspace();
9292
}
9393

9494
@Test

0 commit comments

Comments
 (0)