mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-08-04 03:46:57 -04:00
fix(launch): should not create file when throwing CommandTooLongException. Closes #1606.
This commit is contained in:
parent
08d7ff138b
commit
a80fc34ef1
@ -541,9 +541,6 @@ public class DefaultLauncher extends Launcher {
|
||||
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 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);
|
||||
Charset charset = StandardCharsets.UTF_8;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user