mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 06:12:35 +09:00
Use shell to parse command when using JobStart
Also changed all occurrences of JobStart to JobSpawn in the linter plugin.
This commit is contained in:
@@ -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
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user