From 135b1b51b941d29fd3d3c16452c43ab65aab2db9 Mon Sep 17 00:00:00 2001 From: alessio Date: Tue, 23 Aug 2016 10:58:42 +0200 Subject: [PATCH] files number on startup --- realize/watcher.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/realize/watcher.go b/realize/watcher.go index 6340373..8cd6fb1 100644 --- a/realize/watcher.go +++ b/realize/watcher.go @@ -64,6 +64,7 @@ func (p *Project) watching() { var wr sync.WaitGroup var watcher *fsnotify.Watcher + var counter int64 watcher, err := fsnotify.NewWatcher() if err != nil { log.Println(strings.ToUpper(pname(p.Name, 1)), ":", Red(err.Error())) @@ -83,6 +84,7 @@ func (p *Project) watching() { if err = watcher.Add(path); err != nil { return filepath.SkipDir } + counter++ } } return nil @@ -110,7 +112,8 @@ func (p *Project) watching() { } } - fmt.Println(Red("Watching: " + pname(p.Name, 1) + "\n")) + fmt.Println(Red("Watching: "), pname(p.Name, 1), Magenta(counter), "files") + go routines(p, channel, &wr) p.reload = time.Now().Truncate(time.Second) for {