mirror of
https://github.com/thegeeklab/wp-plugin-go.git
synced 2024-11-21 14:10:39 +00:00
feat: add cmd trace method (#47)
This commit is contained in:
parent
ddde4d726e
commit
5dce9de670
@ -12,6 +12,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http/httptrace"
|
"net/http/httptrace"
|
||||||
"net/textproto"
|
"net/textproto"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"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
Block a user