Skip to content

Commit 24b7279

Browse files
committed
Fix duplicate directories being added to config on first init
'zb' has tried to do something useful if it didn't have any notebook directories configured yet where it could assume the current directory or 'notes' directory if one exists. When creating our initial 'init' we extend the current config, which would initially assume your current directory leading to an extra path being written to the config file when the file wasn't there. It makes more sense now to leave 'zb' without any notebook directories when first called so that the user can configure the notebooks as required and will get an initial experience that is easier to understand.
1 parent 40f3213 commit 24b7279

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func init() {
4444

4545
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", fmt.Sprintf("config file (default is %s)", config.GlobalConfigFile))
4646
rootCmd.PersistentFlags().StringVar(&cfgEditor, "editor", editor.FindEditor(), "program to open notes with")
47-
rootCmd.PersistentFlags().StringSlice("directory", []string{defaultNotebookDir()}, "notebook directories")
47+
rootCmd.PersistentFlags().StringSlice("directory", []string{}, "notebook directories")
4848
viper.BindPFlag("directory", rootCmd.PersistentFlags().Lookup("directory"))
4949
viper.BindPFlag("editor", rootCmd.PersistentFlags().Lookup("editor"))
5050
}

0 commit comments

Comments
 (0)