check run before closing the channel

This commit is contained in:
alessio 2016-08-23 10:52:00 +02:00
parent 385c762ddd
commit 75f1289b5e
1 changed files with 4 additions and 2 deletions

View File

@ -126,8 +126,10 @@ func (p *Project) watching() {
log.Println(pname(p.Name, 4), ":", Magenta(event.Name[:i]))
// stop and run again
close(channel)
wr.Wait()
if p.Run {
close(channel)
wr.Wait()
}
go routines(p, channel, &wr)
p.reload = time.Now().Truncate(time.Second)
}