Skip to content

Commit dae8981

Browse files
committed
misc: replace output => CombinedOutput
1 parent 476ec71 commit dae8981

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func addCrontabTask(c *cron.Cron, Crontab , Cmd string) {
100100
panic("只支持定义 bash 或 cmd 命令执行!")
101101
}
102102

103-
outputByte, outputErr := exec.Command(execCommandFirst,arg,Cmd).Output()
103+
outputByte, outputErr := exec.Command(execCommandFirst,arg,Cmd).CombinedOutput()
104104
checkExec(outputErr, Cmd, outputByte)
105105
}else{
106106
if runtime.GOOS == "windows" {
@@ -123,12 +123,12 @@ func addCrontabTask(c *cron.Cron, Crontab , Cmd string) {
123123
}
124124

125125
func execBash(Cmd string,) {
126-
outputByte, outputErr := exec.Command("bash", "-c", Cmd).Output()
126+
outputByte, outputErr := exec.Command("bash", "-c", Cmd).CombinedOutput()
127127
checkExec(outputErr, Cmd, outputByte)
128128
}
129129

130130
func execCmd(Cmd string,) {
131-
outputByte, outputErr := exec.Command("cmd","/c", Cmd).Output()
131+
outputByte, outputErr := exec.Command("cmd","/c", Cmd).CombinedOutput()
132132
checkExec(outputErr, Cmd, outputByte)
133133
}
134134

0 commit comments

Comments
 (0)