Cmd prints stdout and sterr
This commit is contained in:
parent
b5182bfb9c
commit
fffbad8a44
@ -2,7 +2,7 @@
|
||||
project_name: "don"
|
||||
|
||||
gitea_urls:
|
||||
api: https://git.xsfx.dev/api/v1
|
||||
api: https://git.xsfx.dev/api/v1/
|
||||
|
||||
builds:
|
||||
- main: ./cmd
|
||||
|
4
don.go
4
don.go
@ -5,6 +5,7 @@ package don
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
@ -18,6 +19,9 @@ var errTimeout = errors.New("timeout")
|
||||
func Cmd(c string) func() bool {
|
||||
return func() bool {
|
||||
cmd := exec.Command("sh", "-c", c)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Warn().Err(err).Msg("cmd has error")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user