Skip to content

Commit fedf668

Browse files
committed
fix: ensure config directory exists
1 parent da36d52 commit fedf668

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/cmd/root.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ func ensureConfigDefaults() {
137137
tasklet.MustRun(tasklet.Runner{
138138
StartMsg: "Updating configfile to include defaults",
139139
Runner: func(_ tasklet.TaskletContext) error {
140+
// ensure .config/nitric exists
141+
err := os.MkdirAll(utils.NitricConfigDir(), os.ModePerm)
142+
if err != nil {
143+
return err
144+
}
145+
140146
return viper.SafeWriteConfigAs(path.Join(utils.NitricConfigDir(), ".nitric-config.yaml"))
141147
},
142148
StopMsg: "Configfile updated"}, tasklet.Opts{})

0 commit comments

Comments
 (0)