Skip to content

Instantly share code, notes, and snippets.

@zircote
Created December 13, 2012 16:54
Show Gist options
  • Select an option

  • Save zircote/4277884 to your computer and use it in GitHub Desktop.

Select an option

Save zircote/4277884 to your computer and use it in GitHub Desktop.
Got tired of finding I was not running latest composer version.
#!/bin/bash
COMPOSER=$(type -p "composer.phar")
if [ -x "${COMPOSER}" ]; then
${COMPOSER} self-update > /dev/null
else
$(type -p "php") -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
fi
${COMPOSER} $@
@zircote
Copy link
Author

zircote commented Dec 13, 2012

mkdir -p ~/bin
curl -s https://getcomposer.org/installer | php -- --install-dir=~/bin
wget https://gist.github.com/raw/4277884/66d7ce676fab161c50a6180b495fbbe18a79eb94/composer.sh \
    -O ~/bin/composer
chmod +x ~/bin/composer
composer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment