Skip to content

Commit

Permalink
update watch dir
Browse files Browse the repository at this point in the history
  • Loading branch information
iwannay committed Apr 25, 2020
1 parent f7c1bb6 commit 40549a7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,17 @@ func main() {
var watchDir []string
watchDir = append(watchDir, watchPath)
if watchDirArg != "" {
watchDir = append(watchDir, strings.Split(watchDirArg, ",")...)
elems := strings.Split(watchDirArg, ",")
for _, v := range elems {
if v == "" {
continue
}
wp, err := filepath.Abs(filepath.Clean(v))
if err != nil {
log.Fatalf("[FATAL] %v", err)
}
watchDir = append(watchDir, wp)
}
}
for _, v := range watchDir {
log.Println("[INFO] watch", v, ",file ext", extArr)
Expand Down

0 comments on commit 40549a7

Please sign in to comment.