Check if a bash command is available

# Check if jq is available
if ! command -v jq &>/dev/null; then
    echo "jq command could not be found : you must have jq package installed (brew install jq)"
    exit 1
fi

Source: https://stackoverflow.com/questions/592620/how-can-i-check-if-a-program-exists-from-a-bash-script