Updates the XDG path creation to create needed dirs and panic on failure #113

Manually merged
jboverf merged 3 commits from create-config-dir into develop 2019-12-04 12:39:04 +00:00
1 changed files with 7 additions and 1 deletions

View File

@ -94,7 +94,13 @@ func lowerCaseOpt(opt, val string) string {
}
func loadConfig() error {
file, err := os.Open(bombadillo.Options["configlocation"] + "/.bombadillo.ini")
err := os.MkdirAll(bombadillo.Options["configlocation"], 0755)
if err != nil {
return fmt.Errorf("Error creating configlocation: %s", err.Error())
}
fp := filepath.Join(bombadillo.Options["configlocation"], ".bombadillo.ini")
file, err := os.Open(fp)
if err != nil {
err = saveConfig()
if err != nil {