fix silent windows
This commit is contained in:
@@ -57,6 +57,8 @@ func HandleScriptExecute(ctx context.Context, env *agentRuntime.Env, cmdID strin
|
||||
})
|
||||
}
|
||||
|
||||
hideCmdWindow(cmd)
|
||||
|
||||
timeout := 5 * time.Minute
|
||||
ctx, cancel := context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
|
||||
@@ -10,6 +10,8 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func hideCmdWindow(_ *exec.Cmd) {}
|
||||
|
||||
func startSilentProcess(command string, args []string, cwd string, _ bool) error {
|
||||
ext := strings.ToLower(filepath.Ext(command))
|
||||
|
||||
|
||||
@@ -13,6 +13,13 @@ import (
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
func hideCmdWindow(cmd *exec.Cmd) {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
HideWindow: true,
|
||||
CreationFlags: windows.CREATE_NO_WINDOW,
|
||||
}
|
||||
}
|
||||
|
||||
func startSilentProcess(command string, args []string, cwd string, hideWindow bool) error {
|
||||
ext := strings.ToLower(filepath.Ext(command))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user