Last active
July 19, 2016 13:44
-
-
Save chervand/bb707efaa1d244b1ed38 to your computer and use it in GitHub Desktop.
Composer bootstrap bash script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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