github.com/ddev/ddev@v1.23.2-0.20240519125000-d824ffe36ff3/pkg/ddevapp/global_dotddev_assets/commands/host/heidisql (about)

     1  #!/bin/bash
     2  
     3  ## #ddev-generated: If you want to edit and own this file, remove this line.
     4  ## Description: Run HeidiSQL against current db
     5  ## Usage: heidisql
     6  ## Example: "ddev heidisql"
     7  ## OSTypes: windows,wsl2
     8  ## HostBinaryExists: /mnt/c/Program Files/HeidiSQL/heidisql.exe,C:\Program Files\HeidiSQL\Heidisql.exe
     9  
    10  arguments="--host=\"127.0.0.1\" --port=${DDEV_HOST_DB_PORT} --user=root --password=root --description=${DDEV_SITENAME}"
    11  
    12  if [ "${DDEV_PROJECT_STATUS}" != "running" ] && [ -z "$no_recursion" ]; then
    13    echo "Project ${DDEV_PROJECT} is not running, starting it"
    14    ddev start
    15    start_exit_code=$?
    16    if [ $start_exit_code -ne 0 ]; then
    17      exit $start_exit_code
    18    fi
    19    # run this script again, as the environment is updated after "ddev start"
    20    no_recursion=true ddev "$(basename "$0")" "$@"
    21    exit $?
    22  fi
    23  case $OSTYPE in
    24    "win*"* | "msys"*)
    25      '/c/Program Files/HeidiSQL/heidisql.exe' $arguments &
    26      ;;
    27    # linux-gnu in this case is only WSL2 as selected in OSTypes above
    28    "linux-gnu")
    29      # HeidiSQL is Microsoft only, but we want to start it from WSL2
    30      "/mnt/c/Program Files/HeidiSQL/heidisql.exe" $arguments &
    31      ;;
    32  esac