update
This commit is contained in:
parent
bd9a753bbe
commit
55b64854b2
@ -11,7 +11,6 @@ import (
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.zhangdeman.cn/zhangdeman/command/define"
|
||||
@ -64,7 +63,11 @@ func Execute(workDir string, command string, param []string) *define.Result {
|
||||
cmdInstance := exec.Command(command, param...)
|
||||
cmdInstance.Dir = result.WorkDir
|
||||
result.Output, result.Error = cmdInstance.CombinedOutput()
|
||||
result.Output = []byte(strings.TrimRight(string(result.Output), `\n`))
|
||||
if len(result.Output) >= 2 {
|
||||
if string(result.Output[len(result.Output)-1]) == "n" && string(result.Output[len(result.Output)-2]) == "\\" {
|
||||
result.Output = result.Output[0 : len(result.Output)-2]
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user