feat(init): print success message and next steps after devbox init#2800
feat(init): print success message and next steps after devbox init#2800
Conversation
There was a problem hiding this comment.
Pull request overview
Adds post-devbox init user feedback so users immediately see that initialization succeeded and what to do next.
Changes:
- Print a success line after
devbox initcompletes. - Print “next steps” guidance (e.g.,
devbox add,devbox shell) after initialization.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| if err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
runInitCmd can return nil in --auto --dry-run mode after only printing the config, but this handler will still print "Created devbox.json..." and next steps. That output is misleading for dry-run; consider skipping the success message when flags.dryRun is true (or have runInitCmd return whether a file was actually created).
| } | |
| } | |
| if flags.dryRun { | |
| return nil | |
| } |
| err := runInitCmd(cmd, args, flags) | ||
| path := pathArg(args) | ||
| if path == "" || path == "." { | ||
| path, _ = os.Getwd() |
There was a problem hiding this comment.
os.Getwd() error is ignored here. If it fails, path may become empty and the warning/success messages will be confusing (and it also hides the underlying failure). Please handle the error (e.g., return it or fall back to a safe placeholder).
| path, _ = os.Getwd() | |
| if wd, werr := os.Getwd(); werr != nil { | |
| ux.Fwarningf(cmd.ErrOrStderr(), "could not determine working directory: %v", werr) | |
| path = "<unknown working directory>" | |
| } else { | |
| path = wd | |
| } |
| err := runInitCmd(cmd, args, flags) | ||
| path := pathArg(args) |
There was a problem hiding this comment.
pathArg(args) is computed here but runInitCmd also computes pathArg(args) internally. Consider computing the path once in initCmd and passing it down (or returning it from runInitCmd) to avoid duplicated path-resolution logic.
a2fa226 to
86fc12e
Compare
Summary
Add a success message to devbox init with next steps
How was it tested?
Run
devbox initin a test folder, confirm the message is displayedRerun the command, confirm the error message still displays