Skip to content

Commit

Permalink
codacy
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Dec 11, 2024
1 parent 1afbb6d commit a0f1bfc
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/serverlist-validate-game-icons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ done

echo ""
echo "Checking if an unexpected gameicon exists"
for gameicon in $(ls -1 gameicons); do
for gameicon in gameicons/*; do
# check if $gameicon is in serverlist.csv
if ! grep -q "${gameicon%-icon.png}" serverlist.csv; then
echo "ERROR: gameicon ${gameicon} is not in serverlist.csv"
Expand All @@ -37,4 +37,4 @@ else
echo "OK: gameiconcount ($gameiconcount) matches serverlistcount ($serverlistcount)"
fi

exit ${exitcode}
exit "${exitcode}"
2 changes: 1 addition & 1 deletion .github/workflows/serverlist-validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ for shortname in $(tail -n +2 serverlist.csv | cut -d ',' -f1); do
fi
done

exit ${exitcode}
exit "${exitcode}"
4 changes: 2 additions & 2 deletions lgsm/modules/check_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ fn_install_missing_deps() {

fn_check_loop() {
# Loop though required depenencies checking if they are installed.
for deptocheck in ${array_deps_required[*]}; do
for deptocheck in "${array_deps_required[@]}"; do
fn_deps_detector
done

Expand Down Expand Up @@ -319,7 +319,7 @@ fn_deps_detector() {
fi
# If SteamCMD requirements are not met install will fail.
if [ -n "${appid}" ]; then
for steamcmddeptocheck in ${array_deps_required_steamcmd[*]}; do
for steamcmddeptocheck in "${array_deps_required_steamcmd[@]}"; do
if [ "${deptocheck}" != "steamcmd" ] && [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then
steamcmdfail=1
fi
Expand Down
4 changes: 2 additions & 2 deletions lgsm/modules/command_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ fn_backup_prune() {
fn_backup_relpath() {
# Written by CedarLUG as a "realpath --relative-to" alternative in bash.
# Populate an array of tokens initialized from the rootdir components.
declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g"))
mapfile -t rdirtoks < <(readlink -f "${rootdir}" | sed "s/\// /g")
if [ ${#rdirtoks[@]} -eq 0 ]; then
fn_print_fail_nl "Problem assessing rootdir during relative path assessment"
fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}"
core_exit.sh
fi

# Populate an array of tokens initialized from the backupdir components.
declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g"))
mapfile -t bdirtoks < <(readlink -f "${backupdir}" | sed "s/\// /g")
if [ ${#bdirtoks[@]} -eq 0 ]; then
fn_print_fail_nl "Problem assessing backupdir during relative path assessment"
fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}"
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/command_update_linuxgsm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn_script_log_info "Selecting repo"
curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null
exitcode=$?
if [ "${exitcode}" -ne "0" ]; then
curl curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null
curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null
exitcode=$?
if [ "${exitcode}" -ne "0" ]; then
fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
Expand Down
14 changes: 7 additions & 7 deletions lgsm/modules/mods_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ fn_mod_install_liblist_gam_file() {
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi
fi
Expand All @@ -642,7 +642,7 @@ fn_mod_remove_liblist_gam_file() {
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi

Expand All @@ -658,7 +658,7 @@ fn_mod_remove_liblist_gam_file() {
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi

Expand All @@ -676,7 +676,7 @@ fn_mod_remove_liblist_gam_file() {
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi
fi
Expand All @@ -699,7 +699,7 @@ fn_mod_install_amxmodx_file() {
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi
fi
Expand All @@ -712,7 +712,7 @@ fn_mod_install_amxmodx_file() {
fn_print_fail_eol_nl
core_exit.sh
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi
fi
Expand All @@ -736,7 +736,7 @@ fn_mod_remove_amxmodx_file() {
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi

Expand Down

0 comments on commit a0f1bfc

Please sign in to comment.