From b9c4e27ba4b23e20d9671e89d80d7dbedf188fde Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Mon, 23 Sep 2024 20:21:12 +0200 Subject: [PATCH] fix: disable shellcheck SC2034 --- src/lib/config.sh | 9 +++++++++ src/lib/update.sh | 1 + 2 files changed, 10 insertions(+) diff --git a/src/lib/config.sh b/src/lib/config.sh index bb62352..8de8fd0 100755 --- a/src/lib/config.sh +++ b/src/lib/config.sh @@ -43,39 +43,48 @@ fi config_file="${XDG_CONFIG_HOME:-${HOME}/.config}/${name}/${name}.conf" if grep -Eq '^[[:space:]]*NoColor[[:space:]]*$' "${config_file}" 2> /dev/null; then + # shellcheck disable=SC2034 no_color="y" fi if grep -Eq '^[[:space:]]*NoVersion[[:space:]]*$' "${config_file}" 2> /dev/null; then + # shellcheck disable=SC2034 no_version="y" fi if grep -Eq '^[[:space:]]*AlwaysShowNews[[:space:]]*$' "${config_file}" 2> /dev/null; then + # shellcheck disable=SC2034 show_news="y" fi if grep -Eq '^[[:space:]]*NewsNum[[:space:]]*=[[:space:]]*[1-9][0-9]*[[:space:]]*$' "${config_file}" 2> /dev/null; then + # shellcheck disable=SC2034 news_num=$(grep -E '^[[:space:]]*NewsNum[[:space:]]*=[[:space:]]*[1-9][0-9]*[[:space:]]*$' "${config_file}" 2> /dev/null | awk -F '=' '{print $2}' | tr -d '[:space:]') else + # shellcheck disable=SC2034 news_num="5" fi if grep -Eq '^[[:space:]]*KeepOldPackages[[:space:]]*=[[:space:]]*[0-9]+[[:space:]]*$' "${config_file}" 2> /dev/null; then old_packages_num=$(grep -E '^[[:space:]]*KeepOldPackages[[:space:]]*=[[:space:]]*[0-9]+[[:space:]]*$' "${config_file}" 2> /dev/null | awk -F '=' '{print $2}' | tr -d '[:space:]') else + # shellcheck disable=SC2034 old_packages_num="3" fi if grep -Eq '^[[:space:]]*KeepUninstalledPackages[[:space:]]*=[[:space:]]*[0-9]+[[:space:]]*$' "${config_file}" 2> /dev/null; then uninstalled_packages_num=$(grep -E '^[[:space:]]*KeepUninstalledPackages[[:space:]]*=[[:space:]]*[0-9]+[[:space:]]*$' "${config_file}" 2> /dev/null | awk -F '=' '{print $2}' | tr -d '[:space:]') else + # shellcheck disable=SC2034 uninstalled_packages_num="0" fi if grep -Eq '^[[:space:]]*PrivilegeElevationCommand[[:space:]]*=[[:space:]]*(sudo|doas|run0)[[:space:]]*$' "${config_file}" 2> /dev/null; then + # shellcheck disable=SC2034 su_cmd=$(grep -E '^[[:space:]]*PrivilegeElevationCommand[[:space:]]*=[[:space:]]*(sudo|doas|run0)[[:space:]]*$' "${config_file}" 2> /dev/null | awk -F '=' '{print $2}' | tr -d '[:space:]') fi if grep -Eq '^[[:space:]]*DiffProg[[:space:]]*=[[:space:]]*[^[:space:]].*[[:space:]]*$' "${config_file}" 2> /dev/null; then + # shellcheck disable=SC2034 diff_prog=$(grep -E '^[[:space:]]*DiffProg[[:space:]]*=[[:space:]]*[^[:space:]].*[[:space:]]*$' "${config_file}" 2> /dev/null | awk -F '=' '{print $2}' | tr -d '[:space:]') fi diff --git a/src/lib/update.sh b/src/lib/update.sh index 0f3d78d..7a3aa50 100755 --- a/src/lib/update.sh +++ b/src/lib/update.sh @@ -28,6 +28,7 @@ if [ -n "${aur_packages}" ]; then error_msg "$(eval_gettext "An error has occurred during the update process\nThe update has been aborted\n")" && quit_msg exit 5 else + # shellcheck disable=SC2034 packages_updated="y" fi fi