|
|
@ -45,6 +45,7 @@ func Command(command string, args ...string) (*StarCmd, error) {
|
|
|
|
shell.stdoutBuf = bytes.NewBuffer(make([]byte, 0))
|
|
|
|
shell.stdoutBuf = bytes.NewBuffer(make([]byte, 0))
|
|
|
|
shell.stderrBuf = bytes.NewBuffer(make([]byte, 0))
|
|
|
|
shell.stderrBuf = bytes.NewBuffer(make([]byte, 0))
|
|
|
|
shell.runningChan = make(chan int, 3)
|
|
|
|
shell.runningChan = make(chan int, 3)
|
|
|
|
|
|
|
|
shell.stopctx, shell.stopctxfunc = context.WithCancel(context.Background())
|
|
|
|
cmd := exec.Command(command, args...)
|
|
|
|
cmd := exec.Command(command, args...)
|
|
|
|
shell.CMD = cmd
|
|
|
|
shell.CMD = cmd
|
|
|
|
shell.infile, err = shell.CMD.StdinPipe()
|
|
|
|
shell.infile, err = shell.CMD.StdinPipe()
|
|
|
|