diff --git a/src/main/java/com/mathworks/ci/MatlabBuilder.java b/src/main/java/com/mathworks/ci/MatlabBuilder.java index 6c27f9c0..883cd3e3 100644 --- a/src/main/java/com/mathworks/ci/MatlabBuilder.java +++ b/src/main/java/com/mathworks/ci/MatlabBuilder.java @@ -428,10 +428,10 @@ private synchronized int execMatlabCommand(FilePath workspace, Launcher launcher //Check the test run mode option selected by user and identify the target workspace to copy the scratch file. final String testRunMode = this.getTestRunTypeList().getDescriptor().getId(); - FilePath targetWorkspace = new FilePath(launcher.getChannel(), workspace.getRemote()); // Copy MATLAB scratch file into the workspace only if Automatic option is selected. if (testRunMode.contains(AUTOMATIC_OPTION)) { + FilePath targetWorkspace = new FilePath(launcher.getChannel(), workspace.getRemote()); copyMatlabScratchFileInWorkspace(MATLAB_RUNNER_RESOURCE, MATLAB_RUNNER_TARGET_FILE, targetWorkspace); } } catch (Exception e) {