From d83666625d217d438b071fd67cbca6369552fcb3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 26 Jan 2017 20:44:10 +0000 Subject: [PATCH] update wording for script log --- lgsm/functions/command_mods_install.sh | 4 ++-- lgsm/functions/command_mods_remove.sh | 2 +- lgsm/functions/command_mods_update.sh | 24 +++++++++++------------- lgsm/functions/core_dl.sh | 8 ++++---- lgsm/functions/mods_core.sh | 4 ++-- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh index 7e76ac727..2d85c12f6 100644 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/functions/command_mods_install.sh @@ -25,7 +25,7 @@ if [ ${installedmodscount} -gt 0 ]; then currentmod="${installedmodslist[llindex]}" fn_mod_get_info # Display mod info to the user - echo -e " * \e[1m${green}${modcommand}${default}${default}" + echo -e " * ${green}${modcommand}${default}${default}" done echo "" fi @@ -43,7 +43,7 @@ while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do displayedmodsite="${compatiblemodslist[compatiblemodslistindex+2]}" displayedmoddescription="${compatiblemodslist[compatiblemodslistindex+3]}" # Output mods to the user - echo -e "\e[1m${displayedmodname}${default} - ${displayedmoddescription} - ${displayedmodsite}" + echo -e "${displayedmodname} - ${displayedmoddescription} - ${displayedmodsite}" echo -e " * ${cyan}${displayedmodcommand}${default}" # Increment index from the amount of values we just displayed let "compatiblemodslistindex+=4" diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh index 1a0799122..adf30adea 100644 --- a/lgsm/functions/command_mods_remove.sh +++ b/lgsm/functions/command_mods_remove.sh @@ -26,7 +26,7 @@ for ((mlindex=0; mlindex < ${#installedmodslist[@]}; mlindex++)); do # Get mod info fn_mod_get_info # Display mod info to the user - echo -e "${cyan}${modcommand}${default} - \e[1m${modprettyname}${default} - ${moddescription}" + echo -e "${red}${modcommand}${default} - ${modprettyname} - ${moddescription}" done echo "" diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh index 73827c50c..0b12e04aa 100644 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/functions/command_mods_update.sh @@ -16,27 +16,25 @@ mods_core.sh # For that matter, remove cfg files after extraction before copying them to destination fn_remove_cfg_files(){ if [ "${modkeepfiles}" != "OVERWRITE" ]&&[ "${modkeepfiles}" != "NOUPDATE" ]; then - fn_print_dots "Preventing overwriting of ${modprettyname} config files" - fn_script_log "Preventing overwriting of ${modprettyname} config files" + echo -e "the following files/directories will be preserved:" sleep 0.5 # Count how many files there are to remove - removefilesamount="$(echo "${modkeepfiles}" | awk -F ';' '{ print NF }')" + filestopreserve="$(echo "${modkeepfiles}" | awk -F ';' '{ print NF }')" # Test all subvalues of "modkeepfiles" using the ";" separator - for ((removefilesindex=1; removefilesindex < ${removefilesamount}; removefilesindex++)); do + for ((preservefilesindex=1; preservefilesindex < ${filestopreserve}; preservefilesindex++)); do # Put the current file we are looking for into a variable - filetoremove="$( echo "${modkeepfiles}" | awk -F ';' -v x=${removefilesindex} '{ print $x }' )" + filetopreserve="$(echo "${modkeepfiles}" | awk -F ';' -v x=${preservefilesindex} '{ print $x }' )" + echo -e " * serverfiles/${filetopreserve}" # If it matches an existing file that have been extracted delete the file - if [ -f "${extractdir}/${filetoremove}" ]||[ -d "${extractdir}/${filetoremove}" ]; then - rm -r "${extractdir}/${filetoremove}" + if [ -f "${extractdir}/${filetopreserve}" ]||[ -d "${extractdir}/${filetopreserve}" ]; then + rm -r "${extractdir}/${filetopreserve}" # Write the file path in a tmp file, to rebuild a full file list as it is rebuilt upon update if [ ! -f "${modsdir}/.removedfiles.tmp" ]; then touch "${modsdir}/.removedfiles.tmp" fi - echo "${filetoremove}" >> "${modsdir}/.removedfiles.tmp" + echo "${filetopreserve}" >> "${modsdir}/.removedfiles.tmp" fi done - fn_print_ok "Preventing overwriting of ${modprettyname} config files" - sleep 0.5 fi } @@ -60,12 +58,12 @@ for ((ulindex=0; ulindex < ${#installedmodslist[@]}; ulindex++)); do core_exit.sh # If the mod won't get updated elif [ "${modkeepfiles}" == "NOUPDATE" ]; then - echo -e " * \e[31m${modprettyname}${default} (won't be updated)" + echo -e " * ${red}{modprettyname}${default} (won't be updated)" # If the mode is just overwritten elif [ "${modkeepfiles}" == "OVERWRITE" ]; then - echo -e " * \e[1m${modprettyname}${default} (overwrite)" + echo -e " * ${modprettyname} (overwrite)" else - echo -e " * ${yellow}${modprettyname}${default} (common custom files remain untouched)" + echo -e " * ${yellow}${modprettyname}${default} (retain common custom files)" fi done sleep 1 diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index f7768a7cf..aad8f1963 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -80,12 +80,12 @@ fn_fetch_trap(){ echo "" echo -ne "downloading ${filename}..." fn_print_canceled_eol_nl - fn_script_log_info "downloading ${filename}...CANCELED" + fn_script_log_info "Downloading ${filename}...CANCELED" sleep 1 rm -f "${filedir}/${filename}" | tee -a "${scriptlog}" echo -ne "downloading ${filename}..." fn_print_removed_eol_nl - fn_script_log_info "downloading ${filename}...REMOVED" + fn_script_log_info "Downloading ${filename}...REMOVED" core_exit.sh } @@ -130,7 +130,7 @@ fn_fetch_file(){ if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol_nl if [ -f "${scriptlog}" ]; then - fn_script_log_fatal "downloading ${filename}: FAIL" + fn_script_log_fatal "Downloading ${filename}: FAIL" fi echo -e "${fileurl}" | tee -a "${scriptlog}" echo "${curlcmd}" | tee -a "${scriptlog}" @@ -138,7 +138,7 @@ fn_fetch_file(){ else fn_print_ok_eol_nl if [ -f "${scriptlog}" ]; then - fn_script_log_pass "downloading ${filename}: OK" + fn_script_log_pass "Downloading ${filename}: OK" fi fi # remove trap diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 5fa8e21c9..1eb5984b0 100644 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -41,7 +41,7 @@ fn_mod_lowercase(){ echo -ne "converting ${modprettyname} files to lowercase..." sleep 0.5 - fn_script_log "Converting ${modprettyname} files to lowercase" + fn_script_log_info "Converting ${modprettyname} files to lowercase" files=$(find "${extractdir}" -depth | wc -l) echo -en "\r" while read -r src; do @@ -231,7 +231,7 @@ fn_mods_installed_list(){ ((installedmodsline++)) done if [ -n "${installedmodscount}" ] ;then - fn_script_log_info "${installedmodscount} addons/mods are already installed" + fn_script_log_info "${installedmodscount} addons/mods are currently installed" fi }