I'm trying to create a install.sh script that checks if all my dependencies are installed and then triggers the dependencies scripts.
#!/bin/bash
phpValidation() {
if hash php 2>/dev/null; then
echo 'we have php'
else
echo 'no php'
fi
}
composerValidation() {
if type -t composer ; then #this part does not work
echo 'we have composer'
else
echo 'no composer?!'
fi
}
It works fine for php and yarn, but because composer is an alias it does not get trigged through the script.
How can I check if composer is installed and then trigger it?