Skip to content

Commit dcdd0fc

Browse files
authored
Fix ddev phpmyadmin for Gitpod (#21)
1 parent 5ef107c commit dcdd0fc

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,4 @@ You can run phpMyAdmin easily with the command after installing this add-on:
2121
ddev phpmyadmin
2222
```
2323

24-
> [!TIP]
25-
> 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.
26-
2724
**Contributed and maintained by [@rfay](https://github.com/rfay)**

commands/host/phpmyadmin

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
DDEV_PHPMYADMIN_PORT=8036
99
DDEV_PHPMYADMIN_HTTPS_PORT=8037
1010
if [ ${DDEV_PRIMARY_URL%://*} = "http" ] || [ -n "${GITPOD_WORKSPACE_ID:-}" ] || [ "${CODESPACES:-}" = "true" ]; then
11-
ddev launch :$DDEV_PHPMYADMIN_PORT
11+
# Gitpod: "gp preview" opens a blank page for PhpMyAdmin, use "xdg-open" instead
12+
if [ "${OSTYPE:-}" = "linux-gnu" ] && [ -n "${GITPOD_WORKSPACE_ID:-}" ] && [ -z "${DDEV_DEBUG:-}" ]; then
13+
xdg-open "$(DDEV_DEBUG=true ddev launch :$DDEV_PHPMYADMIN_PORT | grep "FULLURL" | awk '{print $2}')"
14+
else
15+
ddev launch :$DDEV_PHPMYADMIN_PORT
16+
fi
1217
else
1318
ddev launch :$DDEV_PHPMYADMIN_HTTPS_PORT
1419
fi

0 commit comments

Comments
 (0)