setup: MkdirAll config dir if necessary
some have had this issue in the past on new systems/users where ~/.config doesn't exist yet.
This commit is contained in:
@@ -190,6 +190,9 @@ func start(asDaemon, firstCall bool) {
|
|||||||
app.err.Fatalf("Couldn't find default config file")
|
app.err.Fatalf("Couldn't find default config file")
|
||||||
}
|
}
|
||||||
nConfig, err := os.Create(app.configPath)
|
nConfig, err := os.Create(app.configPath)
|
||||||
|
if err != nil && os.IsNotExist(err) {
|
||||||
|
err = os.MkdirAll(filepath.Dir(app.configPath), 0760)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.err.Printf("Couldn't open config file for writing: \"%s\"", app.configPath)
|
app.err.Printf("Couldn't open config file for writing: \"%s\"", app.configPath)
|
||||||
app.err.Fatalf("Error: %s", err)
|
app.err.Fatalf("Error: %s", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user