Skip to content

Commit

Permalink
ci: fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Oct 3, 2024
1 parent 08df1f0 commit b86724d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/util/util_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ func SetProcessGroupID(cmd *exec.Cmd) {
// without killing this process (i.e. this code here).
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
}

func SetProcessCancel(cmd *exec.Cmd) {
cmd.Cancel = func() error {
return TerminateProcess(cmd.Process.Pid)
}
}
6 changes: 6 additions & 0 deletions internal/util/util_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ func SetProcessGroupID(cmd *exec.Cmd) {
// without killing this process (i.e. this code here).
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
}

func SetProcessCancel(cmd *exec.Cmd) {
cmd.Cancel = func() error {
return TerminateProcess(cmd.Process.Pid)
}
}
6 changes: 6 additions & 0 deletions internal/util/util_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ func TerminateProcess(pid int) error {
func SetProcessGroupID(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{}
}

func SetProcessCancel(cmd *exec.Cmd) {
cmd.Cancel = func() error {
return TerminateProcess(cmd.Process.Pid)
}
}

0 comments on commit b86724d

Please sign in to comment.