fix2: fix function install_software (#105)

pull/114/head
xiagw 2020-09-19 15:28:36 +07:00 committed by GitHub
parent a9498beff0
commit d41ead065b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 2>&1 && 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() {