added dependecy check
This commit is contained in:
parent
1d053f1b66
commit
b5c255b3c7
11
bml-cli
11
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user