Skip to content

Commit 2308ea0

Browse files
committed
Create config path before writing
1 parent 19b9a5a commit 2308ea0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

config.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ func (c *Config) Write() error {
6969
return err
7070
}
7171

72-
configPath := filepath.Join(home, ".kaf", "config")
72+
configDir := filepath.Join(home, ".kaf")
73+
_ = os.MkdirAll(configDir, 0755)
74+
configPath := filepath.Join(configDir, "config")
75+
7376
file, err := os.OpenFile(configPath, os.O_TRUNC|os.O_RDWR|os.O_CREATE, 0644)
7477
if err != nil {
7578
panic(err)

0 commit comments

Comments
 (0)