99 */
1010
1111import java .io .IOException ;
12- import java .nio .file .Files ;
13- import java .nio .file .Path ;
1412import java .util .Map ;
1513import java .util .HashMap ;
1614import java .util .List ;
@@ -264,7 +262,7 @@ public void perform(@Nonnull Run<?, ?> build, @Nonnull FilePath workspace,
264262 }
265263 }
266264
267- private int execMatlabCommand (FilePath workspace , Launcher launcher ,/////change needs to be made here.
265+ private int execMatlabCommand (FilePath workspace , Launcher launcher ,
268266 TaskListener listener , EnvVars envVars ) throws IOException , InterruptedException {
269267
270268 /*
@@ -275,17 +273,14 @@ private int execMatlabCommand(FilePath workspace, Launcher launcher,/////change
275273
276274 final String uniqueTmpFldrName = getUniqueNameForRunnerFile ();
277275 ProcStarter matlabLauncher ;
278-
279276 try {
280-
281- FilePath genScriptLocation =
277+ FilePath genScriptLocation =
282278 getFilePathForUniqueFolder (launcher , uniqueTmpFldrName , workspace );
283279
284280 matlabLauncher = getProcessToRunMatlabCommand (workspace , launcher , listener , envVars ,
285281 constructCommandForTest (genScriptLocation ), uniqueTmpFldrName );
286282
287283 // copy genscript package in temp folder and write a runner script.
288-
289284 prepareTmpFldr (genScriptLocation , getRunnerScript (
290285 MatlabBuilderConstants .TEST_RUNNER_SCRIPT , envVars .expand (getInputArguments ()),uniqueTmpFldrName ));
291286
@@ -305,10 +300,9 @@ private int execMatlabCommand(FilePath workspace, Launcher launcher,/////change
305300
306301 public String constructCommandForTest (FilePath scriptPath ) {
307302 final String matlabScriptName = getValidMatlabFileName (scriptPath .getBaseName ());
308-
309303 final String runCommand = "addpath('" + scriptPath .getRemote ().replaceAll ("'" , "''" )
310304 + "'); " + matlabScriptName + ",delete('.matlab/" + scriptPath .getBaseName () + "/"
311- + matlabScriptName + ".m'),runnerScript,rmdir(destination ,'s')" ;
305+ + matlabScriptName + ".m'),runnerScript,rmdir(tmpDir ,'s')" ;
312306 return runCommand ;
313307 }
314308
0 commit comments