Skip to content

Commit

Permalink
fix: add more checks for existing approot (ddev#6208)
Browse files Browse the repository at this point in the history
  • Loading branch information
stasadev authored and jonesrussell committed Jun 9, 2024
1 parent 67ad31b commit 4384cb8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/ddev/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ func handleMainConfigArgs(cmd *cobra.Command, _ []string, app *ddevapp.DdevApp)
app.Name = filepath.Base(pwd)
}

err = app.CheckExistingAppInApproot()
if err != nil {
util.Failed(err.Error())
}

// Ensure that the docroot exists
if docrootRelPathArg != "" {
app.Docroot = docrootRelPathArg
Expand Down
6 changes: 6 additions & 0 deletions pkg/ddevapp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,12 @@ func (app *DdevApp) promptForName() error {
return err
}
app.Name = name

err := app.CheckExistingAppInApproot()
if err != nil {
util.Failed(err.Error())
}

return nil
}

Expand Down

0 comments on commit 4384cb8

Please sign in to comment.