Skip to content

Commit

Permalink
feat: add WSL2 support to tableplus command (#5738) [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
plebward committed Jan 26, 2024
1 parent 7403ef4 commit 00c15ca
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pkg/ddevapp/global_dotddev_assets/commands/host/tableplus
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#ddev-generated
# Support for TablePlus, https://tableplus.com/
# This command is available if macOS and TablePlus is installed in the normal place
# This command is available on macOS and WSL2 if TablePlus is installed in the default location.
## Description: Run tableplus with current project database
## Usage: tableplus
## Example: "ddev tableplus"
## OSTypes: darwin
## HostBinaryExists: /Applications/TablePlus.app
## OSTypes: darwin,wsl2
## HostBinaryExists: /Applications/TablePlus.app,/mnt/c/Program Files/TablePlus/TablePlus.exe

if [ "${DDEV_PROJECT_STATUS}" != "running" ]; then
echo "Project ${DDEV_PROJECT} is not running, starting it"
Expand All @@ -21,6 +21,12 @@ if [[ $dbtype == "postgres" ]]; then
fi
query="${driver}://db:db@127.0.0.1:${DDEV_HOST_DB_PORT}/db"

set -x
open "$query" -a "/Applications/TablePlus.app/Contents/MacOS/TablePlus"

case $OSTYPE in
"linux-gnu")
"/mnt/c/Program Files/TablePlus/TablePlus.exe" $query >/dev/null &
;;
"darwin"*)
set -x
open "$query" -a "/Applications/TablePlus.app/Contents/MacOS/TablePlus"
;;
esac

0 comments on commit 00c15ca

Please sign in to comment.