Last active
May 30, 2020 17:26
-
-
Save leggiero/80baf7dba858dcac203b147b2c4dac7c to your computer and use it in GitHub Desktop.
Install or upgrade compose; ideal to run via cron, e.g. /etc/cron.weekly/composer-upgrade
This file contains 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
#!/bin/sh | |
set -e | |
if [ ! -f /usr/local/bin/composer ]; then | |
setup_file=$(mktemp /tmp/$(basename "$0").XXXXXX) | |
trap "{ rm -f $setup_file; }" EXIT | |
php -r "copy('https://getcomposer.org/installer', '$setup_file');" | |
eval "php $setup_file --quiet --install-dir=/usr/local/bin --filename=composer" | |
else | |
composer --quiet self-update | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment