Improve documentation

This commit is contained in:
Shivam Mathur
2019-10-11 23:09:05 +05:30
parent f7f5b1a7e1
commit 99bbaa2a58
8 changed files with 98 additions and 11 deletions

View File

@ -18,14 +18,11 @@ if [ "$existing_version" != "$1" ]; then
fi
if [ ! -e "/usr/bin/composer" ]; then
EXPECTED_SIGNATURE="$(curl -s https://composer.github.io/installer.sig)" &
curl -s -L https://getcomposer.org/installer > composer-setup.php &
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" &
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then
curl -s -L https://getcomposer.org/installer > composer-setup.php
if [ "$(curl -s https://composer.github.io/installer.sig)" != "$(php -r "echo hash_file('sha384', 'composer-setup.php');")" ]; then
>&2 echo 'ERROR: Invalid installer signature'
else
COMPOSER_ALLOW_SUPERUSER=1
export COMPOSER_ALLOW_SUPERUSER=1
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
fi
rm composer-setup.php