[agent-go] fix-bugs

This commit is contained in:
zeaslity
2023-03-30 16:10:34 +08:00
parent d24a338e80
commit 61481e7543
6 changed files with 27 additions and 6 deletions

View File

@@ -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
}