File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ func main() {
23
23
listFiles := flag .Bool ("list" , false , "list watched files on start" )
24
24
stdinPipe := flag .Bool ("pipe" , false , "pipe event's info to command's stdin" )
25
25
keepalive := flag .Bool ("keepalive" , false , "keep alive when a cmd returns code != 0" )
26
+ ignore := flag .String ("ignore" , "" , "comma separated list of paths to ignore" )
26
27
27
28
flag .Parse ()
28
29
@@ -52,6 +53,21 @@ func main() {
52
53
w := watcher .New ()
53
54
w .IgnoreHiddenFiles (! * dotfiles )
54
55
56
+ // Get any of the paths to ignore.
57
+ ignoredPaths := strings .Split (* ignore , "," )
58
+
59
+ for _ , path := range ignoredPaths {
60
+ trimmed := strings .TrimSpace (path )
61
+ if trimmed == "" {
62
+ continue
63
+ }
64
+
65
+ err := w .Ignore (trimmed )
66
+ if err != nil {
67
+ log .Fatalln (err )
68
+ }
69
+ }
70
+
55
71
done := make (chan struct {})
56
72
go func () {
57
73
defer close (done )
You can’t perform that action at this time.
0 commit comments