Skip to content

Commit

Permalink
setup: MkdirAll config dir if necessary
Browse files Browse the repository at this point in the history
some have had this issue in the past on new systems/users where ~/.config
doesn't exist yet.
  • Loading branch information
hrfee committed Jul 27, 2021
1 parent 67c60cb commit 6e88c1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Expand Up @@ -190,6 +190,9 @@ func start(asDaemon, firstCall bool) {
app.err.Fatalf("Couldn't find default config file")
}
nConfig, err := os.Create(app.configPath)
if err != nil && os.IsNotExist(err) {
err = os.MkdirAll(filepath.Dir(app.configPath), 0760)
}
if err != nil {
app.err.Printf("Couldn't open config file for writing: \"%s\"", app.configPath)
app.err.Fatalf("Error: %s", err)
Expand Down

0 comments on commit 6e88c1f

Please sign in to comment.