mfg
This commit is contained in:
47
.ddev/.global_commands/host/dbeaver
Executable file
47
.ddev/.global_commands/host/dbeaver
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
## #ddev-generated: If you want to edit and own this file, remove this line.
|
||||
## Description: Run DBeaver against current db
|
||||
## Usage: dbeaver
|
||||
## Example: "ddev dbeaver [db] [user]"
|
||||
## OSTypes: darwin,linux
|
||||
## HostBinaryExists: /Applications/DBeaver.app,/usr/bin/dbeaver,/usr/bin/dbeaver-ce,/usr/bin/dbeaver-le,/usr/bin/dbeaver-ue,/usr/bin/dbeaver-ee,/var/lib/flatpak/exports/bin/io.dbeaver.DBeaverCommunity,/snap/bin/dbeaver-ce
|
||||
|
||||
if [ "${DDEV_PROJECT_STATUS}" != "running" ]; then
|
||||
echo "Project ${DDEV_PROJECT} is not running, starting it"
|
||||
ddev start
|
||||
fi
|
||||
|
||||
database="${1:-db}"
|
||||
user="${2:-root}"
|
||||
type="$(echo $DDEV_DATABASE | sed 's/:.*//')"
|
||||
|
||||
if [ "${type}" = "postgres" ]; then
|
||||
type="postgresql"
|
||||
user="${2:-db}"
|
||||
fi
|
||||
|
||||
# See: https://dbeaver.com/docs/wiki/Command-Line/#connection-parameters
|
||||
CONNECTION="name=ddev-${DDEV_PROJECT}|driver=${type}|database=${database}|user=${user}|password=${user}|savePassword=true|host=127.0.0.1|port=${DDEV_HOST_DB_PORT}|openConsole=true|folder=DDEV"
|
||||
|
||||
case $OSTYPE in
|
||||
"linux-gnu")
|
||||
# Check for different binaries. Launch the first one found.
|
||||
BINARIES=(
|
||||
/usr/bin/dbeaver{,-ce,-le,-ue,-ee}
|
||||
/var/lib/flatpak/exports/bin/io.dbeaver.DBeaverCommunity
|
||||
/snap/bin/dbeaver-ce
|
||||
)
|
||||
for binary in "${BINARIES[@]}"; do
|
||||
if [ -x "$binary" ]; then
|
||||
echo "Launching $binary"
|
||||
$binary -con "$CONNECTION" &> /dev/null & disown
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
;;
|
||||
"darwin"*)
|
||||
open -a dbeaver.app --args -con "$CONNECTION" &
|
||||
echo "Attempted to launch DBeaver.app"
|
||||
;;
|
||||
esac
|
||||
25
.ddev/.global_commands/host/heidisql
Executable file
25
.ddev/.global_commands/host/heidisql
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
## #ddev-generated: If you want to edit and own this file, remove this line.
|
||||
## Description: Run HeidiSQL against current db
|
||||
## Usage: heidisql
|
||||
## Example: "ddev heidisql"
|
||||
## OSTypes: windows,wsl2
|
||||
## HostBinaryExists: /mnt/c/Program Files/HeidiSQL/heidisql.exe,C:\Program Files\HeidiSQL\Heidisql.exe
|
||||
|
||||
arguments="--host=\"127.0.0.1\" --port=${DDEV_HOST_DB_PORT} --user=root --password=root --description=${DDEV_SITENAME}"
|
||||
|
||||
if [ "${DDEV_PROJECT_STATUS}" != "running" ]; then
|
||||
echo "Project ${DDEV_PROJECT} is not running, starting it"
|
||||
ddev start
|
||||
fi
|
||||
case $OSTYPE in
|
||||
"win*"* | "msys"*)
|
||||
'/c/Program Files/HeidiSQL/heidisql.exe' $arguments &
|
||||
;;
|
||||
# linux-gnu in this case is only WSL2 as selected in OSTypes above
|
||||
"linux-gnu")
|
||||
# HeidiSQL is Microsoft only, but we want to start it from WSL2
|
||||
"/mnt/c/Program Files/HeidiSQL/heidisql.exe" $arguments &
|
||||
;;
|
||||
esac
|
||||
75
.ddev/.global_commands/host/launch
Executable file
75
.ddev/.global_commands/host/launch
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/bin/bash
|
||||
|
||||
## #ddev-generated: If you want to edit and own this file, remove this line.
|
||||
## Description: Launch a browser with the current site
|
||||
## Usage: launch [path] [-m|--mailpit]
|
||||
## 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
|
||||
|
||||
while :; do
|
||||
case ${1:-} in
|
||||
-p|--phpmyadmin)
|
||||
echo "phpMyAdmin is no longer built into DDEV, please 'ddev get ddev/ddev-phpmyadmin' and use 'ddev phpmyadmin' to launch phpMyAdmin" && exit 2
|
||||
;;
|
||||
-m|--mailpit|--mailhog)
|
||||
if [[ ! -z "${GITPOD_INSTANCE_ID}" ]] || [[ "${CODESPACES}" == "true" ]]; then
|
||||
FULLURL="${FULLURL/-${DDEV_HOST_WEBSERVER_PORT}/-${DDEV_HOST_MAILPIT_PORT}}"
|
||||
else
|
||||
if [ "${HTTPS}" = "" ]; then
|
||||
FULLURL="${FULLURL%:[0-9]*}:${DDEV_MAILPIT_PORT}"
|
||||
else
|
||||
FULLURL="${FULLURL%:[0-9]*}:${DDEV_MAILPIT_HTTPS_PORT}"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
--) # End of all options.
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-?*)
|
||||
printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2
|
||||
;;
|
||||
*) # Default case: No more options, so break out of the loop.
|
||||
break
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -n "${1:-}" ] ; then
|
||||
if [[ ${1::1} != "/" ]] ; then
|
||||
FULLURL="${FULLURL}/";
|
||||
fi
|
||||
|
||||
FULLURL="${FULLURL}${1}";
|
||||
fi
|
||||
|
||||
if [ ! -z ${DDEV_DEBUG:-} ]; then
|
||||
printf "FULLURL $FULLURL\n" && exit 0
|
||||
fi
|
||||
|
||||
case $OSTYPE in
|
||||
linux-gnu)
|
||||
if [[ ! -z "${GITPOD_INSTANCE_ID}" ]]; then
|
||||
gp preview ${FULLURL}
|
||||
else
|
||||
xdg-open ${FULLURL}
|
||||
fi
|
||||
;;
|
||||
"darwin"*)
|
||||
open ${FULLURL}
|
||||
;;
|
||||
"win*"* | "msys"*)
|
||||
start ${FULLURL}
|
||||
;;
|
||||
esac
|
||||
|
||||
8
.ddev/.global_commands/host/mailpit
Executable file
8
.ddev/.global_commands/host/mailpit
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
## #ddev-generated: If you want to edit and own this file, remove this line.
|
||||
## Description: Launch a browser with Mailpit (an email & SMTP testing tool)
|
||||
## Usage: mailpit
|
||||
## Example: "ddev mailpit"
|
||||
|
||||
ddev launch -m
|
||||
19
.ddev/.global_commands/host/querious
Executable file
19
.ddev/.global_commands/host/querious
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
# Support for Querious, https://www.araelium.com/querious
|
||||
## Description: Run querious with current project database
|
||||
## Usage: querious [database]
|
||||
## Example: "ddev querious"
|
||||
## OSTypes: darwin
|
||||
## HostBinaryExists: /Applications/Querious.app
|
||||
## DBTypes: mysql,mariadb
|
||||
|
||||
if [ "${DDEV_PROJECT_STATUS}" != "running" ]; then
|
||||
echo "Project ${DDEV_PROJECT} is not running, starting it"
|
||||
ddev start
|
||||
fi
|
||||
DATABASE="${1:-db}"
|
||||
|
||||
open "querious://connect/new?host=127.0.0.1&user=db&password=db&use-compression=false&database=${DATABASE}&port=${DDEV_HOST_DB_PORT}"
|
||||
|
||||
44
.ddev/.global_commands/host/self-upgrade
Executable file
44
.ddev/.global_commands/host/self-upgrade
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
|
||||
## Description: Explain how to upgrade DDEV
|
||||
## Usage: self-upgrade
|
||||
## Example: "ddev self-upgrade"
|
||||
## CanRunGlobally: true
|
||||
|
||||
mypath=$(which ddev)
|
||||
|
||||
case $mypath in
|
||||
"/usr/bin/ddev")
|
||||
if [[ ${OSTYPE} = "linux-gnu"* ]]; then
|
||||
if command -v apt; then echo "You seem to have an apt-installed ddev, upgrade with 'sudo apt update && sudo apt upgrade -y ddev'";
|
||||
elif [ -f /etc/arch-release ] && command -v yay >/dev/null ; then echo "You seem to have yay-installed ddev (AUR), upgrade with 'yay -Syu ddev-bin'";
|
||||
elif command -v dnf; then echo "You seem to have dnf-installed ddev, upgrade with 'sudo dnf install --refresh ddev'"; fi
|
||||
fi
|
||||
;;
|
||||
|
||||
"/usr/local/bin/ddev")
|
||||
if [ ! -L /usr/local/bin/ddev ]; then
|
||||
printf "DDEV appears to have been installed with install_ddev.sh, you can run that script again to update.\ncurl -fsSL https://raw.githubusercontent.com/ddev/ddev/master/scripts/install_ddev.sh | bash\n"
|
||||
elif command -v brew; then
|
||||
echo "DDEV appears to have been installed with homebrew, upgrade with 'brew update && brew upgrade ddev'"
|
||||
fi
|
||||
;;
|
||||
|
||||
"/opt/homebrew/bin/ddev" | "/home/linuxbrew/.linuxbrew/bin/ddev")
|
||||
if [ -L "$(which ddev)" ] && command -v brew; then
|
||||
echo "DDEV appears to have been installed with homebrew, upgrade with 'brew update && brew upgrade ddev'"
|
||||
fi
|
||||
;;
|
||||
|
||||
"/c/Program Files/DDEV/ddev")
|
||||
printf "DDEV was either installed with\nchoco install -y ddev\nor with the installer package.\n"
|
||||
echo "You can upgrade with 'choco upgrade -y ddev'"
|
||||
echo "Or by downloading the Windows installer from https://github.com/ddev/ddev/releases"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unable to determine how you installed ddev, but you can remove $mypath and reinstall with one of the techniques in https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/"
|
||||
|
||||
esac
|
||||
21
.ddev/.global_commands/host/sequelace
Executable file
21
.ddev/.global_commands/host/sequelace
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run sequelace with current project database
|
||||
## Usage: sequelace
|
||||
## Example: "ddev sequelace" or "ddev sequelace database2" to open a database named "database2".
|
||||
## OSTypes: darwin
|
||||
## HostBinaryExists: /Applications/Sequel ace.app
|
||||
## DBTypes: mysql,mariadb
|
||||
|
||||
DATABASE="${1:-db}"
|
||||
|
||||
if [ "${DDEV_PROJECT_STATUS}" != "running" ]; then
|
||||
echo "Project ${DDEV_PROJECT} is not running, starting it"
|
||||
ddev start
|
||||
fi
|
||||
query="mysql://root:root@${DDEV_PROJECT}.${DDEV_TLD}:${DDEV_HOST_DB_PORT}/${DATABASE}"
|
||||
|
||||
set -x
|
||||
open "$query" -a "/Applications/Sequel Ace.app/Contents/MacOS/Sequel Ace"
|
||||
|
||||
82
.ddev/.global_commands/host/sequelpro
Executable file
82
.ddev/.global_commands/host/sequelpro
Executable file
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
## Description: Run sequelpro with current project database
|
||||
## Usage: sequelpro
|
||||
## Example: "ddev sequelpro"
|
||||
## OSTypes: darwin
|
||||
## HostBinaryExists: /Applications/Sequel Pro.app
|
||||
## DBTypes: mysql,mariadb
|
||||
|
||||
if [ "${DDEV_PROJECT_STATUS}" != "running" ]; then
|
||||
echo "Project ${DDEV_PROJECT} is not running, starting it"
|
||||
ddev start
|
||||
fi
|
||||
tmpdir=$(mktemp -d -t sequelpro-XXXXXXXXXX)
|
||||
templatepath="$tmpdir/sequelpro.spf"
|
||||
|
||||
cat >$templatepath <<END
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>ContentFilters</key>
|
||||
<dict/>
|
||||
<key>auto_connect</key>
|
||||
<true/>
|
||||
<key>data</key>
|
||||
<dict>
|
||||
<key>connection</key>
|
||||
<dict>
|
||||
<key>database</key>
|
||||
<string>db</string>
|
||||
<key>host</key>
|
||||
<string>127.0.0.1</string>
|
||||
<key>name</key>
|
||||
<string>${DDEV_SITENAME}</string>
|
||||
<key>password</key>
|
||||
<string>root</string>
|
||||
<key>port</key>
|
||||
<integer>$DDEV_HOST_DB_PORT</integer>
|
||||
<key>rdbms_type</key>
|
||||
<string>mysql</string>
|
||||
<key>sslCACertFileLocation</key>
|
||||
<string></string>
|
||||
<key>sslCACertFileLocationEnabled</key>
|
||||
<integer>0</integer>
|
||||
<key>sslCertificateFileLocation</key>
|
||||
<string></string>
|
||||
<key>sslCertificateFileLocationEnabled</key>
|
||||
<integer>0</integer>
|
||||
<key>sslKeyFileLocation</key>
|
||||
<string></string>
|
||||
<key>sslKeyFileLocationEnabled</key>
|
||||
<integer>0</integer>
|
||||
<key>type</key>
|
||||
<string>SPTCPIPConnection</string>
|
||||
<key>useSSL</key>
|
||||
<integer>0</integer>
|
||||
<key>user</key>
|
||||
<string>root</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>encrypted</key>
|
||||
<false/>
|
||||
<key>format</key>
|
||||
<string>connection</string>
|
||||
<key>queryFavorites</key>
|
||||
<array/>
|
||||
<key>queryHistory</key>
|
||||
<array/>
|
||||
<key>rdbms_type</key>
|
||||
<string>mysql</string>
|
||||
<key>rdbms_version</key>
|
||||
<string>5.5.44</string>
|
||||
<key>version</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</plist>
|
||||
END
|
||||
|
||||
open "${templatepath}"
|
||||
|
||||
32
.ddev/.global_commands/host/tableplus
Executable file
32
.ddev/.global_commands/host/tableplus
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
#ddev-generated
|
||||
# Support for TablePlus, https://tableplus.com/
|
||||
# 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,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"
|
||||
ddev start
|
||||
fi
|
||||
|
||||
dbtype=${DDEV_DBIMAGE%:*}
|
||||
driver=mysql
|
||||
if [[ $dbtype == "postgres" ]]; then
|
||||
driver=$dbtype
|
||||
fi
|
||||
query="${driver}://db:db@127.0.0.1:${DDEV_HOST_DB_PORT}/db?Enviroment=local&Name=ddev-${DDEV_SITENAME}"
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user