|
|
|
|
@ -222,7 +222,7 @@ func RenderPages() { |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
log.Fatalf("can't walk content") |
|
|
|
|
Fatal(err, "can't walk content") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -255,14 +255,16 @@ func AddWatchDir(watcher *fsnotify.Watcher, name string) error { |
|
|
|
|
func WatchDir() { |
|
|
|
|
watcher, err := fsnotify.NewWatcher() |
|
|
|
|
if err != nil { |
|
|
|
|
log.Fatal(err) |
|
|
|
|
Fatal(err, "can't create new watcher") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
defer watcher.Close() |
|
|
|
|
|
|
|
|
|
wait_time, err := time.ParseDuration(config.Settings.WatchDelay) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Fatal(err) |
|
|
|
|
Fatal(err, |
|
|
|
|
"can't parse watch_delay setting: %s", |
|
|
|
|
config.Settings.WatchDelay) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
doit := time.NewTimer(wait_time) |
|
|
|
|
@ -325,14 +327,14 @@ func InitConfig(config_file string) { |
|
|
|
|
if os.IsNotExist(err) { |
|
|
|
|
out, err := os.Create(config_file) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Fatalf("error opening %s", config_file) |
|
|
|
|
Fatal(err, "error opening %s", config_file) |
|
|
|
|
} |
|
|
|
|
defer out.Close() |
|
|
|
|
|
|
|
|
|
out.WriteString(DEFAULT_CONFIG) |
|
|
|
|
log.Println("new config written to:", config_file) |
|
|
|
|
fmt.Println("new config written to:", config_file) |
|
|
|
|
} else { |
|
|
|
|
log.Fatalf("there's already a %s file here", config_file) |
|
|
|
|
Fatal(err, "there's already a %s file here", config_file) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|