mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
fix: unable to sync files and save data issues
This commit is contained in:
@@ -4,12 +4,18 @@
|
||||
package sys_exec
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func BuildCmd(cmdStr string) *exec.Cmd {
|
||||
return exec.Command("sh", "-c", cmdStr)
|
||||
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
|
||||
}
|
||||
|
||||
func SetPgid(cmd *exec.Cmd) {
|
||||
|
||||
Reference in New Issue
Block a user