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] }