Skip to content

Commit

Permalink
refactor: improve update print messages
Browse files Browse the repository at this point in the history
- Refactored the print messages in the core_steamcmd.sh file to provide more informative output.
- Updated the "Checking local build" and "Checking remote build" messages to include a newline character for better readability.
- Removed unnecessary print message "Checking for update" as it was redundant.
  • Loading branch information
dgibbs64 committed Oct 15, 2023
1 parent d6a8cae commit 4a15f14
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lgsm/modules/core_steamcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ fn_update_steamcmd_localbuild() {

# Checks if localbuild variable has been set.
if [ -z "${localbuild}" ]; then
fn_print_fail "Checking local build: ${remotelocation}: missing local build info"
fn_print_fail_nl "Checking local build: ${remotelocation}: missing local build info"
fn_script_log_fail "Missing local build info"
core_exit.sh
else
fn_print_ok "Checking local build: ${remotelocation}"
fn_print_ok_nl "Checking local build: ${remotelocation}"
fn_script_log_pass "Checking local build"
fi
}
Expand Down Expand Up @@ -187,11 +187,11 @@ fn_update_steamcmd_remotebuild() {
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}"
fn_print_fail_nl "Checking remote build: ${remotelocation}"
fn_script_log_fail "Checking remote build"
core_exit.sh
else
fn_print_ok "Checking remote build: ${remotelocation}"
fn_print_ok_nl "Checking remote build: ${remotelocation}"
fn_script_log_pass "Checking remote build"
fi
else
Expand All @@ -205,12 +205,10 @@ fn_update_steamcmd_remotebuild() {
}

fn_update_steamcmd_compare() {
fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
Expand Down Expand Up @@ -260,7 +258,6 @@ fn_update_steamcmd_compare() {
fi
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
Expand Down

0 comments on commit 4a15f14

Please sign in to comment.