github.com/drud/ddev@v1.21.5-alpha1.0.20230226034409-94fcc4b94453/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  
     9  mypath=$(which ddev)
    10  
    11  case $mypath 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/drud/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/drud/ddev/releases"
    38      ;;
    39  
    40    *)
    41      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/"
    42  
    43  esac