1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

fix: ExecCommand can't compile in macos

This commit is contained in:
dudaodong
2023-04-17 17:03:46 +08:00
parent 18d27604e6
commit 47bdd6718a
3 changed files with 36 additions and 0 deletions

26
system/os_darwin.go Normal file
View File

@@ -0,0 +1,26 @@
//go:build darwin
package system
import (
"os/exec"
"syscall"
)
func WithForeground() Option {
return func(c *exec.Cmd) {
if c.SysProcAttr == nil {
c.SysProcAttr = &syscall.SysProcAttr{
Foreground: true,
}
} else {
c.SysProcAttr.Foreground = true
}
}
}
func WithWinHide() Option {
return func(c *exec.Cmd) {
}
}

View File

@@ -1,3 +1,5 @@
//go:build linux
package system
import (
@@ -16,3 +18,9 @@ func WithForeground() Option {
}
}
}
func WithWinHide() Option {
return func(c *exec.Cmd) {
}
}

View File

@@ -1,3 +1,5 @@
//go:build windows
package system
import (