[agent-go] fix-bugs
This commit is contained in:
@@ -74,7 +74,6 @@ func PipeLineCommandExecutor(pipeLineCommand [][]string) ([]string, error) {
|
||||
lastCmd := cmds[len(cmds)-1]
|
||||
|
||||
var out bytes.Buffer
|
||||
|
||||
lastCmd.Stdout = &out
|
||||
lastCmd.Stderr = &out
|
||||
err := lastCmd.Run()
|
||||
@@ -95,13 +94,12 @@ func PipeLineCommandExecutor(pipeLineCommand [][]string) ([]string, error) {
|
||||
func MultiLineCommandExecutor(multiLineCommandExecutor [][]string) ([]string, error) {
|
||||
|
||||
var res []string
|
||||
|
||||
for _, singleLineCommand := range multiLineCommandExecutor {
|
||||
|
||||
singleLogs, err := SingleLineCommandExecutor(singleLineCommand)
|
||||
res := append(res, singleLogs...)
|
||||
res = append(res, singleLogs...)
|
||||
|
||||
if err != nil {
|
||||
log.Error(fmt.Sprintf("Execution error ! command is %v, error is %v", singleLineCommand, err))
|
||||
return res, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user