Skip to content

Commit

Permalink
Use an array for pacman_color_opt
Browse files Browse the repository at this point in the history
  • Loading branch information
Antiz96 committed Apr 14, 2024
1 parent cb3d4b5 commit 8bbe51d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ if [ -z "${no_color}" ]; then
yellow="${bold}\e[33m"
red="${bold}\e[31m"
color_off="\e[0m"
pacman_color_opt="--color always"
pacman_color_opt+=("--color always")
else
pacman_color_opt="--color never"
pacman_color_opt+=("--color never")
contrib_color_opt="--nocolor"
fi

Expand Down Expand Up @@ -273,9 +273,9 @@ list_packages() {

if [ -n "${aur_helper}" ]; then
if [ -z "${no_version}" ]; then
aur_packages=$("${aur_helper}" "${pacman_color_opt}" "${devel_flag[@]}" -Qua)
aur_packages=$("${aur_helper}" "${pacman_color_opt[@]}" "${devel_flag[@]}" -Qua)
else
aur_packages=$("${aur_helper}" "${pacman_color_opt}" "${devel_flag[@]}" -Qua | awk '{print $1}')
aur_packages=$("${aur_helper}" "${pacman_color_opt[@]}" "${devel_flag[@]}" -Qua | awk '{print $1}')
fi
fi

Expand Down Expand Up @@ -395,7 +395,7 @@ update() {
echo
main_msg "$(eval_gettext "Updating Packages...\n")"

if ! "${su_cmd}" pacman "${pacman_color_opt}" -Syu; then
if ! "${su_cmd}" pacman "${pacman_color_opt[@]}" -Syu; then
icon_updates_available
echo
error_msg "$(eval_gettext "An error has occurred during the update process\nThe update has been aborted\n")" && quit_msg
Expand All @@ -407,7 +407,7 @@ update() {
echo
main_msg "$(eval_gettext "Updating AUR Packages...\n")"

if ! "${aur_helper}" "${pacman_color_opt}" "${devel_flag[@]}" -Syu; then
if ! "${aur_helper}" "${pacman_color_opt[@]}" "${devel_flag[@]}" -Syu; then
icon_updates_available
echo
error_msg "$(eval_gettext "An error has occurred during the update process\nThe update has been aborted\n")" && quit_msg
Expand Down Expand Up @@ -454,7 +454,7 @@ orphan_packages() {
echo
main_msg "$(eval_gettext "Removing Orphan Packages...\n")"

if ! pacman -Qtdq | "${su_cmd}" pacman "${pacman_color_opt}" -Rns -; then
if ! pacman -Qtdq | "${su_cmd}" pacman "${pacman_color_opt[@]}" -Rns -; then
echo
error_msg "$(eval_gettext "An error has occurred during the removal process\nThe removal has been aborted\n")"
else
Expand Down

0 comments on commit 8bbe51d

Please sign in to comment.