diff --git a/README.md b/README.md index 31f585f..2e0ae59 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,4 @@ You can run phpMyAdmin easily with the command after installing this add-on: ddev phpmyadmin ``` -> [!TIP] -> For Gitpod: The `ddev phpmyadmin` command can open a blank page in preview mode, open the link in a new browser tab/window to make it work. - **Contributed and maintained by [@rfay](https://github.com/rfay)** diff --git a/commands/host/phpmyadmin b/commands/host/phpmyadmin index a1cdb80..c03ee85 100644 --- a/commands/host/phpmyadmin +++ b/commands/host/phpmyadmin @@ -8,7 +8,12 @@ DDEV_PHPMYADMIN_PORT=8036 DDEV_PHPMYADMIN_HTTPS_PORT=8037 if [ ${DDEV_PRIMARY_URL%://*} = "http" ] || [ -n "${GITPOD_WORKSPACE_ID:-}" ] || [ "${CODESPACES:-}" = "true" ]; then - ddev launch :$DDEV_PHPMYADMIN_PORT + # Gitpod: "gp preview" opens a blank page for PhpMyAdmin, use "xdg-open" instead + if [ "${OSTYPE:-}" = "linux-gnu" ] && [ -n "${GITPOD_WORKSPACE_ID:-}" ] && [ -z "${DDEV_DEBUG:-}" ]; then + xdg-open "$(DDEV_DEBUG=true ddev launch :$DDEV_PHPMYADMIN_PORT | grep "FULLURL" | awk '{print $2}')" + else + ddev launch :$DDEV_PHPMYADMIN_PORT + fi else ddev launch :$DDEV_PHPMYADMIN_HTTPS_PORT fi