File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/silenceper/gowatch
3
3
go 1.14
4
4
5
5
require (
6
- github.com/howeyc /fsnotify v0.9.0
6
+ github.com/fsnotify /fsnotify v1.5.1
7
7
github.com/mitchellh/go-ps v1.0.0
8
8
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
9
9
github.com/silenceper/log v0.0.0-20171204144354-e5ac7fa8a76a
Original file line number Diff line number Diff line change 1
- github.com/howeyc /fsnotify v0.9.0 h1:0gtV5JmOKH4A8SsFxG2BczSeXWWPvcMT0euZt5gDAxY =
2
- github.com/howeyc /fsnotify v0.9.0 /go.mod h1:41HzSPxBGeFRQKEEwgh49TRw/nKBsYZ2cF1OzPjSJsA =
1
+ github.com/fsnotify /fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI =
2
+ github.com/fsnotify /fsnotify v1.5.1 /go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU =
3
3
github.com/kr/pty v1.1.1 /go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ =
4
4
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE =
5
5
github.com/kr/text v0.1.0 /go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI =
@@ -9,6 +9,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb
9
9
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e /go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno =
10
10
github.com/silenceper/log v0.0.0-20171204144354-e5ac7fa8a76a h1:COf2KvPmardI1M8p2fhHsXlFS2EXSQygbGgcDYBI9Wc =
11
11
github.com/silenceper/log v0.0.0-20171204144354-e5ac7fa8a76a /go.mod h1:nyN/YUSK3CgJjtNzm6dVTkcou+RYXNMP+XLSlzQu0m0 =
12
+ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I =
13
+ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c /go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg =
12
14
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU =
13
15
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
14
16
gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0 h1:POO/ycCATvegFmVuPpQzZFJ+pGZeX22Ufu6fibxDVjU =
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import (
11
11
"strings"
12
12
"time"
13
13
14
- "github.com/howeyc /fsnotify"
14
+ "github.com/fsnotify /fsnotify"
15
15
"github.com/mitchellh/go-ps"
16
16
"github.com/silenceper/log"
17
17
)
@@ -33,7 +33,7 @@ func NewWatcher(paths []string, files []string) {
33
33
go func () {
34
34
for {
35
35
select {
36
- case e := <- watcher .Event :
36
+ case e := <- watcher .Events :
37
37
isbuild := true
38
38
39
39
// Skip ignored files
@@ -66,7 +66,7 @@ func NewWatcher(paths []string, files []string) {
66
66
Autobuild (files )
67
67
}()
68
68
}
69
- case err := <- watcher .Error :
69
+ case err := <- watcher .Errors :
70
70
log .Errorf ("%v" , err )
71
71
log .Warnf (" %s\n " , err .Error ()) // No need to exit here
72
72
}
@@ -76,7 +76,7 @@ func NewWatcher(paths []string, files []string) {
76
76
log .Infof ("Initializing watcher...\n " )
77
77
for _ , path := range paths {
78
78
log .Infof ("Directory( %s )\n " , path )
79
- err = watcher .Watch (path )
79
+ err = watcher .Add (path )
80
80
if err != nil {
81
81
log .Errorf ("Fail to watch directory[ %s ]\n " , err )
82
82
os .Exit (2 )
You can’t perform that action at this time.
0 commit comments