changing exec to always use abs path
parent
b9b75192c5
commit
93c21fac65
6
lib.go
6
lib.go
|
@ -239,7 +239,11 @@ func Exec(str string, opts ...*Opts) ([]*exec.Cmd, error) {
|
||||||
cmdwd = filepath.Join(wd, cmdwd)
|
cmdwd = filepath.Join(wd, cmdwd)
|
||||||
}
|
}
|
||||||
prepCmd := func(l Line) *exec.Cmd {
|
prepCmd := func(l Line) *exec.Cmd {
|
||||||
cmd := exec.Command(l.Tokens[0], l.Tokens[1:]...)
|
fqncmd, err := exec.LookPath(l.Tokens[0])
|
||||||
|
if err != nil {
|
||||||
|
fqncmd = filepath.Join(cmdwd, l.Tokens[0])
|
||||||
|
}
|
||||||
|
cmd := exec.Command(fqncmd, l.Tokens[1:]...)
|
||||||
cmd.Stdout = log.Writer()
|
cmd.Stdout = log.Writer()
|
||||||
cmd.Stderr = log.Writer()
|
cmd.Stderr = log.Writer()
|
||||||
cmd.Dir = cmdwd
|
cmd.Dir = cmdwd
|
||||||
|
|
Loading…
Reference in New Issue