Explorar o código

update wording for script log

Daniel Gibbs %!s(int64=9) %!d(string=hai) anos
pai
achega
d83666625d

+ 2 - 2
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"

+ 1 - 1
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 ""

+ 11 - 13
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

+ 4 - 4
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

+ 2 - 2
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
 }