File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,15 +31,23 @@ func initCmd() *cobra.Command {
3131 Args : cobra .MaximumNArgs (1 ),
3232 RunE : func (cmd * cobra.Command , args []string ) error {
3333 err := runInitCmd (cmd , args , flags )
34+ path := pathArg (args )
35+ if path == "" || path == "." {
36+ path , _ = os .Getwd ()
37+ }
3438 if errors .Is (err , os .ErrExist ) {
35- path := pathArg (args )
36- if path == "" || path == "." {
37- path , _ = os .Getwd ()
38- }
3939 ux .Fwarningf (cmd .ErrOrStderr (), "devbox.json already exists in %q." , path )
40- err = nil
40+ return nil
41+ }
42+ if err != nil {
43+ return err
4144 }
42- return err
45+ if flags .dryRun {
46+ return nil
47+ }
48+ fmt .Fprintf (cmd .OutOrStdout (), "Created devbox.json in %s\n " , path )
49+ fmt .Fprintln (cmd .OutOrStdout (), "Run `devbox add <package>` to add packages, or `devbox shell` to start a dev shell." )
50+ return nil
4351 },
4452 }
4553
You can’t perform that action at this time.
0 commit comments