Browse Source

win: add missing hidewindow syscall

smaller-size
AJ ONeal 5 years ago
parent
commit
63328251fa
  1. 1
      runner/runner.go
  2. 8
      runner/runner_notwindows.go
  3. 10
      runner/runner_windows.go

1
runner/runner.go

@ -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

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

10
runner/runner_windows.go

@ -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}
}

Loading…
Cancel
Save