From a0aace67336b76b4095c812df423a1300ab362e3 Mon Sep 17 00:00:00 2001 From: alessio Date: Mon, 22 Aug 2016 13:29:21 +0200 Subject: [PATCH] run/fast slash fixed --- realize/project.go | 5 +++-- realize/watcher.go | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/realize/project.go b/realize/project.go index 4c995c3..9901455 100644 --- a/realize/project.go +++ b/realize/project.go @@ -31,12 +31,13 @@ func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup) stop := make(chan bool, 1) var run string - if len(name) == 1 { - name := strings.Split(p.base, "/") + if name[len(name)-1] == "" { + name := strings.Split(slash(p.base), "/") run = name[len(name)-1] } else { run = name[len(name)-1] } + build := exec.Command(slash(os.Getenv("GOBIN")) + slash(run)) build.Dir = p.base defer func() { diff --git a/realize/watcher.go b/realize/watcher.go index f633afa..6c99187 100644 --- a/realize/watcher.go +++ b/realize/watcher.go @@ -45,6 +45,7 @@ func (h *Config) Fast(params *cli.Context) error { fast := h.Projects[0] // Takes the values from config if wd path match someone else if params.Bool("config") { + fmt.Println(params.Bool("config")) if err := h.Read(); err == nil { for _, val := range h.Projects { if fast.Path == val.Path { @@ -104,7 +105,6 @@ func (p *Project) Watching() { defer end() p.base = base + p.Path - for _, dir := range p.Watcher.Paths { // check main existence dir = slash(dir) @@ -230,10 +230,8 @@ func slash(str string) string { str = "/" + str } if string(str[len(str)-1]) == "/" { - if len(str) == 0 { + if string(str) == "/" { return str - } else if string(str) == "/" { - str = "" } else { str = str[0 : len(str)-1] }