base commit

This commit is contained in:
Barak Michener 2016-10-31 15:10:02 -07:00
parent 4d7acdc014
commit 5d40de4bf3
3 changed files with 125 additions and 0 deletions

19
watch.go Normal file
View file

@ -0,0 +1,19 @@
package hoboken
import (
"log"
"github.com/rjeczalik/notify"
)
func WatchDir(path string, p *Projects) {
c := make(chan notify.EventInfo, 1)
if err := notify.Watch(path, c, notify.All); err != nil {
log.Fatal(err)
}
defer notify.Stop(c)
for _ = range c {
p.Reload()
}
}