Skip to content

Commit

Permalink
Refactor handling of Composer to be version based
Browse files Browse the repository at this point in the history
More in line with how a provisioning script should handle things. If the expected version of Composer is not installed, either install it or update to that version. If the expected version is installed, don't waste time looking for the update.
  • Loading branch information
jeremyfelt committed May 24, 2013
1 parent bca08e5 commit 851ac8c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions provision/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,19 @@ ln -fs /usr/bin/ack-grep /usr/bin/ack

# COMPOSER
#
# Install Composer
if [ ! -f /home/vagrant/flags/disable_composer ]
# Install or Update Composer based on expected hash from repository
if composer --version | grep -q 'Composer version e4b48d39d';
then
if [ ! -f /usr/local/bin/composer ]
then
printf "Install Composer...\n"
curl -sS https://getcomposer.org/installer | php
chmod +x composer.phar
mv composer.phar /usr/local/bin/composer
else
printf "composer already installed\n"
fi
printf "Composer already installed\n"
elif composer --version | grep -q 'Composer version';
then
printf "Updating Composer version\n"
composer self-update
else
printf "Install Composer...\n"
curl -sS https://getcomposer.org/installer | php
chmod +x composer.phar
mv composer.phar /usr/local/bin/composer
fi

# If our global composer sources don't exist, set them up
Expand Down

0 comments on commit 851ac8c

Please sign in to comment.