Skip to content

Instantly share code, notes, and snippets.

@chervand
Last active July 19, 2016 13:44
Show Gist options
  • Save chervand/bb707efaa1d244b1ed38 to your computer and use it in GitHub Desktop.
Save chervand/bb707efaa1d244b1ed38 to your computer and use it in GitHub Desktop.
Composer bootstrap bash script
#!/usr/bin/env bash
# Composer bootstrap script
# https://getcomposer.org/
# https://gist.github.com/chervand/bb707efaa1d244b1ed38
function trace () {
echo "... ${@}" && "$@"
}
_source="$(readlink -f ${BASH_SOURCE[0]})"
_scriptPath="$(dirname ${_source})"
trace cd ${_scriptPath}
if [ -x "$(command -v composer)" ]; then
trace composer $@
else
if [ ! -f composer.phar ]; then
curl -sS https://getcomposer.org/installer | php
fi
trace php composer.phar $@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment