Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion internal/impl/devbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func InitConfig(dir string, writer io.Writer) (created bool, err error) {
Commit: plansdk.DefaultNixpkgsCommit,
},
}

// package suggestion
pkgsToSuggest, err := initrec.Get(dir)
if err != nil {
return false, err
Expand All @@ -59,6 +59,16 @@ func InitConfig(dir string, writer io.Writer) (created bool, err error) {
color.HiYellowString(s),
)
}
// .envrc file creation
envrcfilePath := filepath.Join(dir, ".envrc")
filesExist := fileutil.Exists(envrcfilePath)
if !filesExist { // don't overwrite an existing .envrc
err := generate.CreateEnvrc(tmplFS, dir)
if err != nil { //move forward with devbox init flow and not interrupt
debug.Log("Failed to generate .envrc file. Reason: %s", err)
}
}

return cuecfg.InitFile(cfgPath, config)
}

Expand Down