[ Agent ] [ Executor ] - fix bugs
This commit is contained in:
@@ -70,8 +70,13 @@ func FormatAllCommandExecutor(singleLineCommand []string) ([]string, error) {
|
||||
// result
|
||||
var resultSlice []string
|
||||
var resultError error
|
||||
var cmd *exec.Cmd
|
||||
|
||||
cmd := exec.Command(singleLineCommand[0], singleLineCommand[1:]...)
|
||||
if len(singleLineCommand) > 1 {
|
||||
cmd = exec.Command(singleLineCommand[0], singleLineCommand[1:]...)
|
||||
} else {
|
||||
cmd = exec.Command(singleLineCommand[0])
|
||||
}
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
log.ErrorF("command %v stdout error => %v", singleLineCommand, err)
|
||||
|
||||
Reference in New Issue
Block a user