mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
19 lines
318 B
Go
19 lines
318 B
Go
//go:build windows
|
|
// +build windows
|
|
|
|
package sys_exec
|
|
|
|
import (
|
|
"errors"
|
|
"os/exec"
|
|
"strings"
|
|
)
|
|
|
|
func BuildCmd(cmdStr string) (cmd *exec.Cmd, err error) {
|
|
if cmdStr == "" {
|
|
return nil, errors.New("command string is empty")
|
|
}
|
|
args := strings.Split(cmdStr, " ")
|
|
return exec.Command(args[0], args[1:]...), nil
|
|
}
|