feat: log event

This commit is contained in:
Urko 2023-02-26 16:26:13 +01:00
parent a67ef6f2d8
commit 49a72dc34b
2 changed files with 3 additions and 1 deletions

View File

@ -45,10 +45,12 @@ func (w *watcher) Listen(binaryPath, scriptPath string, outputErr chan<- error)
outputErr <- errEventsClosedChan outputErr <- errEventsClosedChan
return return
} }
if !event.Has(fsnotify.Write) { if !event.Has(fsnotify.Write) {
log.Printf("is not Write: %s\n", event.Name) log.Printf("is not Write: %s\n", event.Name)
continue continue
} }
log.Printf("event: %s | op: %s \n", event.Name, event.Op)
if err := w.deploy(binaryPath, scriptPath); err != nil { if err := w.deploy(binaryPath, scriptPath); err != nil {
log.Printf("deploy: %s\n", err) log.Printf("deploy: %s\n", err)

View File

@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
echo "hello" echo "deploy script has been called"