Corrected ScriptExecution and added tests

This commit is contained in:
2016-06-12 22:36:09 -04:00
parent 763b7361ec
commit f8aeef14e3
9 changed files with 157 additions and 3 deletions

View File

@@ -84,9 +84,8 @@ public class ScriptExecution extends Command {
throw new CommandRunException(CommandRunExceptionType.USAGE,
"Expecting a file", this); //$NON-NLS-1$
}
List<String> argsList = Arrays.asList(args);
String scriptFile = argsList.remove(0);
Object[] params = argsList.toArray();
String scriptFile = args[0];
Object[] params = Arrays.copyOfRange(args, 1, args.length);
try (FileReader fReader = new FileReader(new File(scriptFile));
BufferedReader reader = new BufferedReader(fReader)) {
String cmd;