configuremgr watcher specific directory and if event occured, call installConfigure...
authorjaehoon.hyun <jaehoon.hyun@samsung.com>
Wed, 27 Mar 2019 07:22:03 +0000 (16:22 +0900)
committerjaehoon.hyun <jaehoon.hyun@samsung.com>
Wed, 27 Mar 2019 07:22:03 +0000 (16:22 +0900)
src/configuremgr/incubator/watcherfs.go

index 01d4f40..e7cb974 100644 (file)
@@ -1,7 +1,7 @@
 package main\r
 \r
 import (\r
-    "log"\r
+       "log"\r
        "github.com/fsnotify/fsnotify"\r
 )\r
 \r
@@ -23,8 +23,8 @@ func main() {
                 if !ok {\r
                     return\r
                 }\r
-                if event.Op&fsnotify.Write == fsnotify.Write {\r
-                    log.Println("modified file:", event.Name)\r
+                if event.Op & fsnotify.Create == fsnotify.Create {\r
+                                               installConfigure(event.Name)\r
                 }\r
             case err, ok := <-watcher.Errors:\r
                 if !ok {\r