channel fixed

This commit is contained in:
alessio 2016-08-23 16:32:25 +02:00
parent 6c64284767
commit 487d69b298
1 changed files with 1 additions and 6 deletions

View File

@ -149,6 +149,7 @@ func (p *Project) watching() {
if p.Run { if p.Run {
close(channel) close(channel)
wr.Wait() wr.Wait()
channel = make(chan bool)
} }
err := p.fmt(event.Name[:i]+ext) err := p.fmt(event.Name[:i]+ext)
if err == nil { if err == nil {
@ -233,16 +234,10 @@ func (p *Project) ignore(str string) bool {
// Routines launches the following methods: run, build, fmt, install // Routines launches the following methods: run, build, fmt, install
func routines(p *Project, channel chan bool, wr *sync.WaitGroup) { func routines(p *Project, channel chan bool, wr *sync.WaitGroup) {
channel = make(chan bool)
//err := p.fmt()
//if err == nil {
wr.Add(1) wr.Add(1)
go p.build() go p.build()
go p.install(channel, wr) go p.install(channel, wr)
wr.Wait() wr.Wait()
//} else {
// fmt.Println(Red(err))
//}
} }
// check if a string is inArray // check if a string is inArray