mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 17:10:10 +00:00
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:
parent
67c60cb677
commit
6e88c1f4fc
3
main.go
3
main.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user