Skip to content

Commit

Permalink
Use an array for contrib_color_opt
Browse files Browse the repository at this point in the history
  • Loading branch information
Antiz96 committed Apr 14, 2024
1 parent 93a6724 commit 30f3ed5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if [ -z "${no_color}" ]; then
pacman_color_opt="always"
else
pacman_color_opt="never"
contrib_color_opt="--nocolor"
contrib_color_opt+=("--nocolor")
fi

# Create state and tmp dirs if they don't exist
Expand Down Expand Up @@ -266,9 +266,9 @@ list_packages() {
icon_checking

if [ -z "${no_version}" ]; then
packages=$(checkupdates "${contrib_color_opt}")
packages=$(checkupdates "${contrib_color_opt[@]}")
else
packages=$(checkupdates "${contrib_color_opt}" | awk '{print $1}')
packages=$(checkupdates "${contrib_color_opt[@]}" | awk '{print $1}')
fi

if [ -n "${aur_helper}" ]; then
Expand Down Expand Up @@ -530,7 +530,7 @@ packages_cache() {
echo
main_msg "$(eval_gettext "Removing old cached packages...")"

if ! "${su_cmd}" paccache "${contrib_color_opt}" -rk"${old_packages_num}"; then
if ! "${su_cmd}" paccache "${contrib_color_opt[@]}" -rk"${old_packages_num}"; then
echo
error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")"
else
Expand All @@ -540,7 +540,7 @@ packages_cache() {
echo
main_msg "$(eval_gettext "Removing uninstalled cached packages...")"

if ! "${su_cmd}" paccache "${contrib_color_opt}" -ruk"${uninstalled_packages_num}"; then
if ! "${su_cmd}" paccache "${contrib_color_opt[@]}" -ruk"${uninstalled_packages_num}"; then
echo
error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")"
else
Expand All @@ -550,7 +550,7 @@ packages_cache() {
echo
main_msg "$(eval_gettext "Removing old cached packages...")"

if ! "${su_cmd}" paccache "${contrib_color_opt}" -rk"${old_packages_num}"; then
if ! "${su_cmd}" paccache "${contrib_color_opt[@]}" -rk"${old_packages_num}"; then
echo
error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")"
else
Expand All @@ -559,7 +559,7 @@ packages_cache() {

main_msg "$(eval_gettext "Removing uninstalled cached packages...")"

if ! "${su_cmd}" paccache "${contrib_color_opt}" -ruk"${uninstalled_packages_num}"; then
if ! "${su_cmd}" paccache "${contrib_color_opt[@]}" -ruk"${uninstalled_packages_num}"; then
echo
error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")"
else
Expand Down Expand Up @@ -596,7 +596,7 @@ pacnew_files() {
echo
main_msg "$(eval_gettext "Processing Pacnew Files...\n")"

"${su_cmd}" pacdiff "${contrib_color_opt}"
"${su_cmd}" pacdiff "${contrib_color_opt[@]}"
echo
info_msg "$(eval_gettext "The pacnew file(s) processing has been applied\n")"
;;
Expand Down

0 comments on commit 30f3ed5

Please sign in to comment.