Files
sing-box-extended-mirror/common/settings/command.go
T

22 lines
442 B
Go
Raw Normal View History

2022-07-14 20:30:57 +08:00
package settings
import (
"os"
"os/exec"
)
func runCommand(name string, args ...string) error {
command := exec.Command(name, args...)
command.Env = os.Environ()
command.Stdin = os.Stdin
command.Stdout = os.Stderr
command.Stderr = os.Stderr
return command.Run()
}
2022-08-04 22:01:20 +08:00
func readCommand(name string, args ...string) ([]byte, error) {
command := exec.Command(name, args...)
command.Env = os.Environ()
return command.CombinedOutput()
}