Skip to content

Commit

Permalink
Add install_composer.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Aug 15, 2019
1 parent 86632a9 commit 3990e03
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
2019-08-15 DariusIII
* Chg: Add install_composer shell script to install latest version of composer
2019-08-14 DariusIII
* Chg: Add and start updating nntmux:resetpp command
2019-08-13 DariusIII
Expand Down
18 changes: 18 additions & 0 deletions install_composer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"

if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi

php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
mv composer.phar /usr/local/bin/composer
exit $RESULT

0 comments on commit 3990e03

Please sign in to comment.