added php-composer to install setup script
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# offical code snipet to get composer for unix:
|
||||
# https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md
|
||||
# ----------------------------------------------------------
|
||||
|
||||
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
|
||||
exit $RESULT
|
||||
|
||||
@@ -72,6 +72,27 @@ install_collection 'extra utilities: (ncdu, zip, php, rclone, etc.)' ncdu zip un
|
||||
|
||||
# ----------------------------------------------------------
|
||||
|
||||
if [[ -n $(command -v "php") ]]; then
|
||||
read -p 'Install PHP Composer? [y/N]: ' response
|
||||
case "${response}" in
|
||||
[Yy]* )
|
||||
return_dir=$(pwd)
|
||||
cd "${package_dir}"
|
||||
"${package_dir}/composer-install/composer-install.sh"
|
||||
if [[ -f "composer.phar" ]]; then
|
||||
sudo mv composer.phar /usr/bin/composer
|
||||
fi
|
||||
cd "${return_dir}"
|
||||
;;
|
||||
* )
|
||||
echo 'Skipping'
|
||||
;;
|
||||
esac
|
||||
echo ''
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------
|
||||
|
||||
read -p 'Install Docker? [y/N]: ' response
|
||||
case "${response}" in
|
||||
[Yy]* )
|
||||
@@ -106,8 +127,9 @@ install_collection 'Ruby: (ruby, build-essential)' ruby-full build-essential zli
|
||||
|
||||
# ----------------------------------------------------------
|
||||
|
||||
read -p 'Configure GEM_HOME and PATH for Ruby support? [y/N]: ' response
|
||||
case "${response}" in
|
||||
if [[ -n $(command -v "ruby") ]]; then
|
||||
read -p 'Configure GEM_HOME and PATH for Ruby support? [y/N]: ' response
|
||||
case "${response}" in
|
||||
[Yy]* )
|
||||
make_bashrc_backup
|
||||
( cat << 'BASHRC'
|
||||
@@ -122,8 +144,9 @@ BASHRC
|
||||
* )
|
||||
echo 'Skipping'
|
||||
;;
|
||||
esac
|
||||
echo ''
|
||||
esac
|
||||
echo ''
|
||||
fi
|
||||
|
||||
# ----------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user