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

     1  #!/bin/bash
     2  
     3  #ddev-generated
     4  
     5  ## Description: Explain how to upgrade DDEV
     6  ## Usage: self-upgrade
     7  ## Example: "ddev self-upgrade"
     8  ## CanRunGlobally: true
     9  
    10  for ddev_path in $(which -a ddev); do
    11    case $ddev_path in
    12      "/usr/bin/ddev")
    13        if [[ ${OSTYPE} = "linux-gnu"* ]]; then
    14          if command -v apt; then echo "You seem to have an apt-installed DDEV, upgrade with 'sudo apt update && sudo apt upgrade -y ddev'";
    15          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'";
    16          elif command -v dnf; then echo "You seem to have dnf-installed DDEV, upgrade with 'sudo dnf install --refresh ddev'"; fi
    17        fi
    18        ;;
    19  
    20      "/usr/local/bin/ddev")
    21        if [ ! -L /usr/local/bin/ddev ]; then
    22          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"
    23        elif command -v brew; then
    24          echo "DDEV appears to have been installed with Homebrew, upgrade with 'brew update && brew upgrade ddev'"
    25        fi
    26        ;;
    27  
    28      "/opt/homebrew/bin/ddev" | "/home/linuxbrew/.linuxbrew/bin/ddev")
    29        if [ -L "$(which ddev)" ] && command -v brew; then
    30          echo "DDEV appears to have been installed with Homebrew, upgrade with 'brew update && brew upgrade ddev'"
    31        fi
    32        ;;
    33  
    34      "/c/Program Files/DDEV/ddev")
    35        printf "DDEV was either installed with\nchoco install -y ddev\nor with the installer package.\n"
    36        echo "You can upgrade with 'choco upgrade -y ddev'"
    37        echo "Or by downloading the Windows installer from https://github.com/ddev/ddev/releases"
    38        ;;
    39  
    40      *)
    41        echo "Unable to determine how you installed DDEV, but you can remove $ddev_path and reinstall with one of the techniques in https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/"
    42  
    43    esac
    44  done