From e2a637065d025c71cc3564b214be167f474f8c58 Mon Sep 17 00:00:00 2001 From: alessio Date: Tue, 23 Aug 2016 13:06:39 +0200 Subject: [PATCH] fixed file counter --- realize/watcher.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/realize/watcher.go b/realize/watcher.go index 8cd6fb1..5938e0f 100644 --- a/realize/watcher.go +++ b/realize/watcher.go @@ -84,7 +84,9 @@ func (p *Project) watching() { if err = watcher.Add(path); err != nil { return filepath.SkipDir } - counter++ + if inArray(filepath.Ext(path), p.Watcher.Exts) { + counter++ + } } } return nil @@ -112,7 +114,7 @@ func (p *Project) watching() { } } - fmt.Println(Red("Watching: "), pname(p.Name, 1), Magenta(counter), "files") + fmt.Println(Red("Watching: "), pname(p.Name, 1), Magenta(counter), "files \n") go routines(p, channel, &wr) p.reload = time.Now().Truncate(time.Second) @@ -126,7 +128,7 @@ func (p *Project) watching() { if _, err := os.Stat(event.Name); err == nil { i := strings.Index(event.Name, filepath.Ext(event.Name)) if event.Name[:i] != "" { - log.Println(pname(p.Name, 4), ":", Magenta(event.Name[:i])) + log.Println(pname(p.Name, 4), ":", Magenta(event.Name)) // stop and run again if p.Run {