X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=cmd%2Fmicro%2Fjob.go;h=df9151b5490883331892dcbf6a3c38ddfe97e919;hb=f58c5412a81135b39a36a02d46b1c17ec2b0554c;hp=829954b226f6405e6a6788577e85c25936a3cf67;hpb=d13f9602ff228f83c1d1d149aed3a287a93016ff;p=micro.git diff --git a/cmd/micro/job.go b/cmd/micro/job.go index 829954b2..df9151b5 100644 --- a/cmd/micro/job.go +++ b/cmd/micro/job.go @@ -4,7 +4,6 @@ import ( "bytes" "io" "os/exec" - "strings" ) // Jobs are the way plugins can run processes in the background @@ -43,10 +42,7 @@ func (f *CallbackFile) Write(data []byte) (int, error) { // JobStart starts a shell command in the background with the given callbacks // It returns an *exec.Cmd as the job id func JobStart(cmd string, onStdout, onStderr, onExit string, userargs ...string) *exec.Cmd { - split := strings.Split(cmd, " ") - cmdArgs := split[1:] - cmdName := split[0] - return JobSpawn(cmdName, cmdArgs, onStdout, onStderr, onExit, userargs...) + return JobSpawn("sh", []string{"-c", cmd}, onStdout, onStderr, onExit, userargs...) } // JobSpawn starts a process with args in the background with the given callbacks