diff --git a/bml-cli b/bml-cli index ce1c2d8..82c7b7f 100755 --- a/bml-cli +++ b/bml-cli @@ -45,6 +45,16 @@ animate(){ printf "\r${@} [${anim:$h:1}]" done } +dependency_check(){ + for DEPENDENCY; do + if ! command -v "$DEPENDENCY" 1>/dev/null; then + printf "%s not found. Please install it.\n" "$DEPENDENCY" >&2 + exit 2 + fi + done + unset DEPENDENCY +} + initialize(){ echo initalizing.. mkdir -p ~/.config/bml-cli/ @@ -766,6 +776,7 @@ init_login(){ enter_credentials fi } +dependency_check "curl" "jq" "openssl" "perl" display_banner && check_connection #& animate "Checking Internet Connection" source $CONFIG source $CREDENTIALS