From 77646917bbcf9ef4a8179393a361eebd47677051 Mon Sep 17 00:00:00 2001 From: xiagw Date: Thu, 17 Sep 2020 11:22:49 +0700 Subject: [PATCH] fix: fix function install_software --- install-release.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/install-release.sh b/install-release.sh index 1f0866b..16aa178 100644 --- a/install-release.sh +++ b/install-release.sh @@ -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() {