Skip to content

Commit

Permalink
Create config path before writing
Browse files Browse the repository at this point in the history
  • Loading branch information
birdayz committed Feb 16, 2019
1 parent 19b9a5a commit 2308ea0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ func (c *Config) Write() error {
return err
}

configPath := filepath.Join(home, ".kaf", "config")
configDir := filepath.Join(home, ".kaf")
_ = os.MkdirAll(configDir, 0755)
configPath := filepath.Join(configDir, "config")

file, err := os.OpenFile(configPath, os.O_TRUNC|os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
panic(err)
Expand Down

0 comments on commit 2308ea0

Please sign in to comment.