changing exec to always use abs path
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user