]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/tasks/SystemCall.java
Add generate script
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / tasks / SystemCall.java
index 87a45905ac8ade9793bedb43c97e31428a89e145..4d7e5d05dbc8013d7b8d829787bec8cc0b7f3ded 100644 (file)
@@ -193,20 +193,22 @@ public class SystemCall extends TreeSRelatedHelper implements Runnable,
                        throw new UnsupportedException();
                }
 
-               if (osConsole != null)
-                       commandLine = CommandLine.parse(osConsole + " "
-                                       + commandLine.toString());
-
                if (generateScript != null) {
                        File scriptFile = new File(getExecDirToUse() + File.separator
                                        + generateScript);
                        try {
-                               FileUtils.writeStringToFile(scriptFile, commandLine.toString());
+                               FileUtils.writeStringToFile(scriptFile,
+                                               (osConsole != null ? osConsole + " " : "")
+                                                               + commandLine.toString());
                        } catch (IOException e) {
                                throw new SlcException("Could not generate script "
                                                + scriptFile, e);
                        }
                        commandLine = new CommandLine(scriptFile);
+               } else {
+                       if (osConsole != null)
+                               commandLine = CommandLine.parse(osConsole + " "
+                                               + commandLine.toString());
                }
 
                return commandLine;