added trace
This commit is contained in:
parent
dfdb8f0c50
commit
5bac0b2643
7
lib.go
7
lib.go
@ -8,6 +8,7 @@ import (
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -49,6 +50,7 @@ const (
|
||||
// Opts.SetupProc will customize the processes before execution - Eg.: setting out and err
|
||||
type Opts struct {
|
||||
Debug bool
|
||||
Trace bool
|
||||
Await bool
|
||||
Wd string
|
||||
SetupProc func(cmd *exec.Cmd)
|
||||
@ -227,6 +229,11 @@ func Exec(str string, opts ...*Opts) ([]*exec.Cmd, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if opt.Trace {
|
||||
bs := debug.Stack()
|
||||
log.Printf("Running: %s\n%s", str, string(bs))
|
||||
}
|
||||
|
||||
cmdwd := opt.Wd
|
||||
|
||||
prepCmd := func(l Line) *exec.Cmd {
|
||||
|
Loading…
x
Reference in New Issue
Block a user