From bcd5b6191802b3189ba536c5b7ce84d64e9e1553 Mon Sep 17 00:00:00 2001 From: asoseil Date: Sat, 11 Nov 2017 22:53:29 +0100 Subject: [PATCH] exec name collision --- exec.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exec.go b/exec.go index 82984ce..bfdff8d 100644 --- a/exec.go +++ b/exec.go @@ -148,26 +148,26 @@ func (p *Project) command(stop <-chan bool, cmd Command) (string, string) { var stderr bytes.Buffer done := make(chan error) args := strings.Split(strings.Replace(strings.Replace(cmd.Command, "'", "", -1), "\"", "", -1), " ") - exec := exec.Command(args[0], args[1:]...) - exec.Dir = p.Path + ex := exec.Command(args[0], args[1:]...) + ex.Dir = p.Path // make cmd path if cmd.Path != "" { if strings.Contains(cmd.Path, p.Path) { - exec.Dir = cmd.Path + ex.Dir = cmd.Path } else { - exec.Dir = filepath.Join(p.Path, cmd.Path) + ex.Dir = filepath.Join(p.Path, cmd.Path) } } - exec.Stdout = &stdout - exec.Stderr = &stderr + ex.Stdout = &stdout + ex.Stderr = &stderr // Start command - exec.Start() - go func() { done <- exec.Wait() }() + ex.Start() + go func() { done <- ex.Wait() }() // Wait a result select { case <-stop: // Stop running command - exec.Process.Kill() + ex.Process.Kill() return "", "" case err := <-done: // Command completed