From 55198da4be55ae8d71c3eb752b4eded4c02b0267 Mon Sep 17 00:00:00 2001 From: alessio Date: Mon, 21 Nov 2016 22:57:14 +0100 Subject: [PATCH] workflow fixed --- watcher/watcher.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/watcher/watcher.go b/watcher/watcher.go index 61240c7..468f303 100644 --- a/watcher/watcher.go +++ b/watcher/watcher.go @@ -22,18 +22,17 @@ func (p *Project) watching() { channel, exit := make(chan bool, 1), make(chan bool, 1) p.path = p.Path watcher, err := fsnotify.NewWatcher() - if err != nil { - log.Println(strings.ToUpper(p.pname(p.Name, 1)), ":", p.Red.Bold(err.Error())) - return - } defer func() { - watcher.Close() wg.Done() }() + if err != nil { + log.Fatalln(p.pname(p.Name, 2), ":", p.Red.Bold(err.Error())) + return + } p.cmd(exit) if p.walks(watcher) != nil { - log.Println(strings.ToUpper(p.pname(p.Name, 1)), ":", p.Red.Bold(err.Error())) + log.Fatalln(p.pname(p.Name, 2), ":", p.Red.Bold(err.Error())) return } go p.routines(channel, &wr)