Skip to content

Commit

Permalink
dont auto start global commands, fixes ddev#2688
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Dec 4, 2023
1 parent 4ecddd9 commit a9b5c59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmd/ddev/cmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,10 @@ func makeHostCmd(app *ddevapp.DdevApp, fullPath, name string) func(*cobra.Comman

return func(cmd *cobra.Command, cobraArgs []string) {
status, _ := app.SiteStatus()
if status != ddevapp.SiteRunning {
err := app.Start()
if err != nil {
util.Failed("Failed to start project for custom command: %v", err)
}
}

app.DockerEnv()

_ = os.Setenv("DDEV_PROJECT_STATUS", status)
osArgs := []string{}
if len(os.Args) > 2 {
osArgs = os.Args[2:]
Expand Down
4 changes: 4 additions & 0 deletions pkg/ddevapp/global_dotddev_assets/commands/host/launch
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
## Example: "ddev launch" or "ddev launch /admin/reports/status/php" or "ddev launch phpinfo.php", for Mailpit "ddev launch -m"
## Flags: [{"Name":"mailpit","Shorthand":"m","Usage":"ddev launch -m launches the mailpit UI"}]

if [ ${DDEV_PROJECT_STATUS} != "running" ]; then
echo "Project ${DDEV_PROJECT} is not running, starting it"
ddev start
fi
FULLURL=${DDEV_PRIMARY_URL}
HTTPS=""
if [ ${DDEV_PRIMARY_URL%://*} = "https" ]; then HTTPS=true; fi
Expand Down

0 comments on commit a9b5c59

Please sign in to comment.