From 9cd07380e531d3e728622648d8a2cb8de0cb8132 Mon Sep 17 00:00:00 2001 From: alessio Date: Wed, 17 Aug 2016 20:06:09 +0200 Subject: [PATCH] fix path problem --- realize/watcher.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/realize/watcher.go b/realize/watcher.go index 1a60d05..5dfcf19 100644 --- a/realize/watcher.go +++ b/realize/watcher.go @@ -75,19 +75,18 @@ func (p *Project) Watching() { defer end() - p.Path = slash(p.Path) p.Main = slash(p.Main) - p.Base = base + p.Path + p.base = base + p.Path for _, dir := range p.Watcher.Paths { // check main existence dir = slash(dir) - if _, err := os.Stat(p.Base + dir + p.Main); err != nil { - Fail(p.Name + ": \t" + p.Base + dir + p.Main + " doesn't exist. Main is required") + if _, err := os.Stat(p.base + dir + p.Main); err != nil { + Fail(p.Name + ": \t" + p.base + dir + p.Main + " doesn't exist. Main is required") return } - base = p.Base + dir + base = p.base + dir if _, err := os.Stat(base); err == nil { if err := filepath.Walk(base, walk); err != nil { Fail(err.Error()) @@ -167,7 +166,7 @@ func (p *Project) run(channel chan bool, wr *sync.WaitGroup) { func (p *Project) ignore(str string) bool { for _, v := range p.Watcher.Ignore { v = slash(v) - if strings.Contains(str, p.Base + v) { + if strings.Contains(str, p.base + v) { return true } }