From 12781ca85582b21088d9db0555178aa6e0f04274 Mon Sep 17 00:00:00 2001 From: alessio Date: Tue, 16 Aug 2016 18:36:54 +0200 Subject: [PATCH] fix build --- realize/project.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/realize/project.go b/realize/project.go index 274ce91..d1a168a 100644 --- a/realize/project.go +++ b/realize/project.go @@ -27,6 +27,9 @@ func (p *Project) GoRun(channel chan bool, wr *sync.WaitGroup) error { path := base + p.Path build.Dir = path defer func() { + if err := build.Process.Kill(); err != nil { + log.Fatal("failed to stop: ", err) + } LogFail(p.Name + ": Stopped") wr.Done() }() @@ -40,7 +43,7 @@ func (p *Project) GoRun(channel chan bool, wr *sync.WaitGroup) error { } in := bufio.NewScanner(stdout) - for in.Scan() { + for in.Scan(){ select { default: log.Println(p.Name + ":", in.Text()) @@ -57,14 +60,13 @@ func (p *Project) GoBuild() error { path := base + p.Path // create bin dir - if _, err := os.Stat(path + "bin"); err != nil { - if err = os.Mkdir(path + "bin", 0777); err != nil { + if _, err := os.Stat(path + "/bin"); err != nil { + if err = os.Mkdir(path + "/bin", 0777); err != nil { return err } } - - build := exec.Command("go", "build", path + p.Main) - build.Dir = path + "bin" + build := exec.Command("go", "build", path + "/" + p.Main) + build.Dir = path + "/bin" build.Stdout = &out if err := build.Run(); err != nil { return err