2022-12-11 06:48:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
##makedesc: Install psalm
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "==============================================="
|
|
|
|
echo "Installing psalm..."
|
|
|
|
echo "==============================================="
|
|
|
|
echo
|
|
|
|
|
|
|
|
installed() {
|
|
|
|
command -v "$1" >/dev/null 2>&1
|
|
|
|
}
|
|
|
|
|
|
|
|
! installed 'php' && echo 'ERROR: You need php to be installed' && exit 1
|
|
|
|
! installed "composer" && echo "ERROR: You need composer to be installed" && exit 2
|
|
|
|
|
|
|
|
COMPOSER_GLOBAL_HOME="$(composer config -g home)"
|
|
|
|
NEWPATH="export PATH=\"$COMPOSER_GLOBAL_HOME/vendor/bin:\${PATH}\""
|
2023-04-14 04:06:40 +00:00
|
|
|
cat "$HOME/.profile" | grep -qoh "$NEWPATH" || {
|
2022-12-11 06:48:30 +00:00
|
|
|
$NEWPATH
|
2023-04-14 04:06:40 +00:00
|
|
|
echo "$NEWPATH" >> "$HOME/.profile"
|
2022-12-11 06:48:30 +00:00
|
|
|
}
|
2023-04-14 04:06:40 +00:00
|
|
|
source "$HOME/.profile"
|
2022-12-11 06:48:30 +00:00
|
|
|
|
|
|
|
composer global require vimeo/psalm --dev
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Finish!"
|
2022-12-28 07:20:25 +00:00
|
|
|
psalm --version
|
2023-04-11 15:43:14 +00:00
|
|
|
echo
|