Files
sailpoint-cli/util/exec.go
2022-09-20 16:32:31 -04:00

20 lines
503 B
Go

// Copyright (c) 2022, SailPoint Technologies, Inc. All rights reserved.
//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd
// +build linux darwin dragonfly freebsd netbsd openbsd
package util
import (
"os/exec"
"syscall"
)
// ExecCommand runs commands on non windows environment with Setpgid flag set to true
func ExecCommand(name string, arg ...string) error {
cmd := exec.Command(name, arg...)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
return cmd.Start()
}