[Agent] [Executor] 优化Functional Executor

This commit is contained in:
zeaslity
2023-10-12 11:42:58 +08:00
parent 62712dfbce
commit 0a294fa81b
7 changed files with 136 additions and 71 deletions

View File

@@ -57,7 +57,7 @@ func Execute(em *ExecutionMessage) ([]string, error) {
realCommand = em.MultiLineCommand
} else {
// 单行命令
resultLog, err = AllOutputCommandExecutor(em.SingleLineCommand)
resultLog, err = FormatAllCommandExecutor(em.SingleLineCommand)
realCommand = [][]string{em.SingleLineCommand}
}
}
@@ -117,7 +117,7 @@ func MultiLineCommandExecutor(multiLineCommandExecutor [][]string) ([]string, er
var res []string
for _, singleLineCommand := range multiLineCommandExecutor {
singleLogs, err := AllOutputCommandExecutor(singleLineCommand)
singleLogs, err := FormatAllCommandExecutor(singleLineCommand)
res = append(res, singleLogs...)
if err != nil {
log.Error(fmt.Sprintf("Execution error ! command is %v, error is %v", singleLineCommand, err))