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() { install_software() {
COMPONENT="$1" COMPONENT="$1"
if [[ -n "$(command -v "$COMPONENT")" ]]; then command -v "$COMPONENT" > /dev/null 2>&1 && return
return if ${PACKAGE_MANAGEMENT_INSTALL} "$COMPONENT"; then
fi echo "info: $COMPONENT is installed."
${PACKAGE_MANAGEMENT_INSTALL} "$COMPONENT" else
if [[ "$?" -ne '0' ]]; then
echo "error: Installation of $COMPONENT failed, please check your network." echo "error: Installation of $COMPONENT failed, please check your network."
exit 1 exit 1
fi fi
echo "info: $COMPONENT is installed."
} }
version_number() { version_number() {