turnstile

Drupal paywall plugin
Log | Files | Refs | README | LICENSE

setup-drush.sh (930B)


      1 #!/bin/bash
      2 
      3 # Exit immediately if a command exits with a non-zero status
      4 set -e
      5 
      6 echo "Updating package list..."
      7 sudo apt update
      8 
      9 echo "Installing required packages..."
     10 sudo apt install -y curl php-cli unzip git php-mbstring php-xml php-curl
     11 
     12 # Install Composer (PHP package manager) if not already installed
     13 if ! command -v composer &> /dev/null; then
     14   echo "Composer not found, installing Composer..."
     15   curl -sS https://getcomposer.org/installer | php
     16   sudo mv composer.phar /usr/local/bin/composer
     17 else
     18   echo "Composer is already installed."
     19 fi
     20 
     21 # Install Drush Launcher globally
     22 if ! command -v drush &> /dev/null; then
     23   echo "Installing Drush Launcher..."
     24   curl -OL https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar
     25   chmod +x drush.phar
     26   sudo mv drush.phar /usr/local/bin/drush
     27 else
     28   echo "Drush is already installed."
     29 fi
     30 
     31 echo "Drush installed successfully. Version:"
     32 drush --version