From 84c4383fdf5985ee3705c8f7134454e90cf50b0e Mon Sep 17 00:00:00 2001 From: alessio Date: Tue, 23 Aug 2016 02:23:17 +0200 Subject: [PATCH] #4 fixed --- realize/watcher.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/realize/watcher.go b/realize/watcher.go index 7c27034..50c235b 100644 --- a/realize/watcher.go +++ b/realize/watcher.go @@ -59,16 +59,6 @@ func (h *Config) Fast(params *cli.Context) error { return nil } -func routines(p *Project, channel chan bool, wr *sync.WaitGroup) { - channel = make(chan bool) - err := p.fmt() - if err == nil { - wr.Add(1) - go p.build() - go p.install(channel, wr) - } -} - // Watching method is the main core. It manages the livereload and the watching func (p *Project) watching() { @@ -214,6 +204,19 @@ func (p *Project) ignore(str string) bool { return false } +// Routines launches the following methods: run, build, fmt, install +func routines(p *Project, channel chan bool, wr *sync.WaitGroup) { + channel = make(chan bool) + err := p.fmt() + if err == nil { + wr.Add(1) + go p.build() + go p.install(channel, wr) + } else { + fmt.Println(Red(err)) + } +} + // check if a string is inArray func inArray(str string, list []string) bool { for _, v := range list {