diff --git a/lib.go b/lib.go index 2dc62cf..f17bcd4 100644 --- a/lib.go +++ b/lib.go @@ -239,7 +239,11 @@ func Exec(str string, opts ...*Opts) ([]*exec.Cmd, error) { cmdwd = filepath.Join(wd, cmdwd) } 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.Stderr = log.Writer() cmd.Dir = cmdwd