changing exec to always use abs path

master
Paulo Simão 2021-10-29 18:18:37 -03:00
parent bcfdbd4327
commit b9b75192c5
1 changed files with 3 additions and 1 deletions

4
lib.go
View File

@ -235,7 +235,9 @@ func Exec(str string, opts ...*Opts) ([]*exec.Cmd, error) {
}
cmdwd := opt.Wd
if !filepath.IsAbs(cmdwd) {
cmdwd = filepath.Join(wd, cmdwd)
}
prepCmd := func(l Line) *exec.Cmd {
cmd := exec.Command(l.Tokens[0], l.Tokens[1:]...)
cmd.Stdout = log.Writer()