Merge commit '52c4d1f' into feat/remote-node
# Conflicts: # internal/db/db.go
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/david/knox/internal/db"
|
||||
"github.com/david/knox/internal/watch"
|
||||
@@ -25,7 +27,10 @@ func NewWatchCmd(kdb *db.KnoxDB) *cobra.Command {
|
||||
log.Printf("[knox] starting watcher, scanning %d directories", len(dirs))
|
||||
w := watch.New(kdb, dirs)
|
||||
if err := w.Start(); err != nil {
|
||||
log.Fatalf("watcher error: %v", err)
|
||||
// Not log.Fatalf: --quiet redirects the logger to io.Discard,
|
||||
// so a fatal exit must reach the user on stderr directly.
|
||||
fmt.Fprintf(os.Stderr, "watcher error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user