win: add missing hidewindow syscall

Cette révision appartient à :
AJ ONeal 2019-07-03 03:04:28 -06:00
Parent fa6d7afa05
révision 63328251fa
3 fichiers modifiés avec 13 ajouts et 6 suppressions

Voir le fichier

@ -52,6 +52,7 @@ func Run(conf *service.Service) {
start := time.Now()
cmd := exec.Command(binpath, args...)
backgroundCmd(cmd)
fmt.Fprintf(lf, "[%s] Starting %q %s \n", time.Now(), binpath, strings.Join(args, " "))
cmd.Stdin = nil

8
runner/runner_notwindows.go Fichier normal
Voir le fichier

@ -0,0 +1,8 @@
// +build !windows
package runner
import "os/exec"
func backgroundCmd(cmd *exec.Cmd) {
}

Voir le fichier

@ -2,11 +2,9 @@ package runner
import (
"os/exec"
"syscall"
)
func init() {
cmd, _ := exec.LookPath("cmd.exe")
if "" != cmd {
shellArgs = []string{cmd, "/c"}
}
}
func backgroundCmd(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
}