Fixes, configs and scripts

This commit is contained in:
Ismo Vuorinen
2023-03-30 16:32:30 +03:00
parent bb3f4a8f6c
commit 11969bf791
6 changed files with 42 additions and 5 deletions

19
scripts/install-composer.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
mv composer.phar ~/.local/bin/composer
exit $RESULT