feat: add cmd trace method (#47)
This commit is contained in:
parent
ddde4d726e
commit
5dce9de670
|
@ -12,6 +12,9 @@ import (
|
|||
"fmt"
|
||||
"net/http/httptrace"
|
||||
"net/textproto"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
@ -117,3 +120,8 @@ func HTTP(ctx context.Context) context.Context {
|
|||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Cmd prints the executed command to stdout.
|
||||
func Cmd(cmd *exec.Cmd) {
|
||||
fmt.Fprintf(os.Stdout, "+ %s\n", strings.Join(cmd.Args, " "))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue