fix: fix function install_software

pull/100/head
xiagw 2020-09-17 11:22:49 +07:00
parent 7e2d0acbf0
commit 5a69fdac4d
No known key found for this signature in database
GPG Key ID: AA79D99901C34E05
1 changed files with 4 additions and 6 deletions

View File

@ -214,15 +214,13 @@ judgment_parameters() {
install_software() {
COMPONENT="$1"
if [[ -n "$(command -v "$COMPONENT")" ]]; then
return
fi
${PACKAGE_MANAGEMENT_INSTALL} "$COMPONENT"
if [[ "$?" -ne '0' ]]; then
command -v "$COMPONENT" >/dev/null && return
if ${PACKAGE_MANAGEMENT_INSTALL} "$COMPONENT"; then
echo "info: $COMPONENT is installed."
else
echo "error: Installation of $COMPONENT failed, please check your network."
exit 1
fi
echo "info: $COMPONENT is installed."
}
version_number() {