From e3583d9c1609ae7293a10a95ef4937a8480eecb4 Mon Sep 17 00:00:00 2001 From: eostre Date: Tue, 15 Sep 2020 13:21:52 -0400 Subject: [PATCH] long overdue commit: have composer test if its already installed --- .../files/install-drupal-toolchain.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/dbd-autobuild/files/install-drupal-toolchain.sh b/dbd-autobuild/files/install-drupal-toolchain.sh index c8850ae..0aa585a 100644 --- a/dbd-autobuild/files/install-drupal-toolchain.sh +++ b/dbd-autobuild/files/install-drupal-toolchain.sh @@ -1,15 +1,21 @@ #!/bin/bash -xe -# install composer -curl -sS https://getcomposer.org/installer | php -mv composer.phar /usr/local/bin/composer +# install composer if it's not already installed +which composer || (\ + curl -sS https://getcomposer.org/installer | php && \ + mv composer.phar /usr/local/bin/composer && \ +:) && (\ + composer self-update &&\ +:) # use composer to install drush7 and the drush launcher cd /var/www composer require drush/drush:8.* -wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar -chmod +x drush.phar -mv drush.phar /usr/local/bin/drush +# ^^ PLEASE note that we're installing DRUSH 8, not Drupal 8. drush8 works fine with drupal7 +## actually don't install the drush launcher because it doesn't work with the latest release of drupal7 +#wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar +#chmod +x drush.phar +#mv drush.phar /usr/local/bin/drush # use vendor/bin/drush to download drupal cd /var/www -- 2.25.1