You are here

Running multiple versions of Drush on the same server

Submitted by Alan Mels on Thu, 10/24/2024 - 01:47

I had to come up with this script to run two different drush versions:

nano /usr/local/bin/drush

and paste:

  1. #!/bin/bash
  2.  
  3. if [[ "$PWD" =~ domains/new.pksupplies.com ]]; then
  4. /usr/bin/php /home/pksupplies/domains/new.pksupplies.com/public_html/vendor/bin/drush.php $1
  5. elif [[ "$PWD" =~ /home/pksupplies/public_html ]]; then
  6. /usr/bin/php /home/pksupplies/drush/drush $1
  7. else
  8. echo "Current working directory does not have any Drupal installation."
  9. fi