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}]"
|
printf "\r${@} [${anim:$h:1}]"
|
||||||
done
|
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(){
|
initialize(){
|
||||||
echo initalizing..
|
echo initalizing..
|
||||||
mkdir -p ~/.config/bml-cli/
|
mkdir -p ~/.config/bml-cli/
|
||||||
@ -766,6 +776,7 @@ init_login(){
|
|||||||
enter_credentials
|
enter_credentials
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
dependency_check "curl" "jq" "openssl" "perl"
|
||||||
display_banner && check_connection #& animate "Checking Internet Connection"
|
display_banner && check_connection #& animate "Checking Internet Connection"
|
||||||
source $CONFIG
|
source $CONFIG
|
||||||
source $CREDENTIALS
|
source $CREDENTIALS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user