mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-10 20:37:30 -04:00
Update script format
This commit is contained in:
parent
67feca075b
commit
16952f5695
@ -509,6 +509,7 @@ public class DefaultLauncher extends Launcher {
|
|||||||
writer.write(' ');
|
writer.write(' ');
|
||||||
writer.write(CommandBuilder.pwshString(rawCommand));
|
writer.write(CommandBuilder.pwshString(rawCommand));
|
||||||
}
|
}
|
||||||
|
writer.newLine();
|
||||||
} else {
|
} else {
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
writer.write("@echo off");
|
writer.write("@echo off");
|
||||||
@ -550,10 +551,10 @@ public class DefaultLauncher extends Launcher {
|
|||||||
}
|
}
|
||||||
if (!scriptFile.setExecutable(true))
|
if (!scriptFile.setExecutable(true))
|
||||||
throw new PermissionException();
|
throw new PermissionException();
|
||||||
if (usePowerShell && !CommandBuilder.hasExecutionPolicy()) {
|
|
||||||
|
if (usePowerShell && !CommandBuilder.hasExecutionPolicy())
|
||||||
throw new ExecutionPolicyLimitException();
|
throw new ExecutionPolicyLimitException();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void startMonitors(ManagedProcess managedProcess, ProcessListener processListener, boolean isDaemon) {
|
private void startMonitors(ManagedProcess managedProcess, ProcessListener processListener, boolean isDaemon) {
|
||||||
processListener.setProcess(managedProcess);
|
processListener.setProcess(managedProcess);
|
||||||
|
@ -187,8 +187,8 @@ public final class CommandBuilder {
|
|||||||
return "Unrestricted".equalsIgnoreCase(policy) || "RemoteSigned".equalsIgnoreCase(policy);
|
return "Unrestricted".equalsIgnoreCase(policy) || "RemoteSigned".equalsIgnoreCase(policy);
|
||||||
}
|
}
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean setExecutionPolicy() {
|
public static boolean setExecutionPolicy() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user