From a076aadf38e1c6d5ef9b42cdaa4c6aa51da65383 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 4 Sep 2023 13:02:30 +0100 Subject: [PATCH] refactor: improve installation process The code changes in this commit refactor the installation process. The `command_install.sh` file has been modified to remove unnecessary code. Additionally, the `install_complete.sh` file has been updated to provide more informative messages based on the exit code. This improves the overall clarity and user experience during installation. Co-authored-by: AI Assistant --- lgsm/modules/command_install.sh | 4 +--- lgsm/modules/install_complete.sh | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lgsm/modules/command_install.sh b/lgsm/modules/command_install.sh index 783f0c7c0..b3edd67c8 100644 --- a/lgsm/modules/command_install.sh +++ b/lgsm/modules/command_install.sh @@ -48,8 +48,6 @@ else fix.sh install_stats.sh install_complete.sh - if [ -z "${exitcode}" ]; then - exitcode=0 - fi + fi core_exit.sh diff --git a/lgsm/modules/install_complete.sh b/lgsm/modules/install_complete.sh index 58189a4be..013ba7334 100644 --- a/lgsm/modules/install_complete.sh +++ b/lgsm/modules/install_complete.sh @@ -9,7 +9,21 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "=================================" -echo -e "Install Complete!" + +if [ "${exitcode}" == "1" ]; then + echo -e "Install Failed!" + fn_script_log_fatal "Install Failed!" +elif [ "${exitcode}" == "2" ]; then + echo -e "Install Completed with Errors!" + fn_script_log_error "Install Completed with Errors!" +elif [ "${exitcode}" == "3" ]; then + echo -e "Install Completed with Warnings!" + fn_script_log_warn "Install Completed with Warnings!" +elif [ -z "${exitcode}" ] || [ "${exitcode}" == "0" ]; then + echo -e "Install Complete!" + fn_script_log_pass "Install Complete!" +fi + fn_script_log_info "Install Complete!" echo -e "" echo -e "To start server type:"