fix(launch): should not create file when throwing CommandTooLongException. Closes #1606.
This commit is contained in:
@@ -541,9 +541,6 @@ public class DefaultLauncher extends Launcher {
|
|||||||
throw new IllegalArgumentException("The extension of " + scriptFile + " is not 'sh' or 'ps1' in macOS/Linux");
|
throw new IllegalArgumentException("The extension of " + scriptFile + " is not 'sh' or 'ps1' in macOS/Linux");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FileUtils.makeFile(scriptFile))
|
|
||||||
throw new IOException("Script file: " + scriptFile + " cannot be created.");
|
|
||||||
|
|
||||||
final Command commandLine = generateCommandLine(nativeFolder);
|
final Command commandLine = generateCommandLine(nativeFolder);
|
||||||
final String command = usePowerShell ? null : commandLine.commandLine.toString();
|
final String command = usePowerShell ? null : commandLine.commandLine.toString();
|
||||||
|
|
||||||
@@ -553,6 +550,9 @@ public class DefaultLauncher extends Launcher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!FileUtils.makeFile(scriptFile))
|
||||||
|
throw new IOException("Script file: " + scriptFile + " cannot be created.");
|
||||||
|
|
||||||
OutputStream outputStream = new FileOutputStream(scriptFile);
|
OutputStream outputStream = new FileOutputStream(scriptFile);
|
||||||
Charset charset = StandardCharsets.UTF_8;
|
Charset charset = StandardCharsets.UTF_8;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user