Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add WSL2 support to tableplus command #5738

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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