Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add styling to differentiate each steps of the main script more easily #55

Merged
merged 5 commits into from
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ list_news() {
echo -e "\n---\nTitle: ${news_selected}\nAuthor: ${news_author}\nPublication date: ${news_date}\nURL: ${news_url}\n---\n\n${news_article}\n" && read -n 1 -r -s -p $'Press \"enter\" to continue\n'
;;
*)
echo
redo="n"
;;
esac
Expand All @@ -176,6 +175,7 @@ update() {
list_news

if [ -n "${packages}" ]; then
echo -e "\n--Updating Packages--"
if ! "${su_cmd}" pacman -Syu; then
icon_updates_available
echo -e >&2 "\nAn error has occurred\nThe update has been aborted\n" && read -n 1 -r -s -p $'Press \"enter\" to quit\n'
Expand All @@ -184,6 +184,7 @@ update() {
fi

if [ -n "${aur_packages}" ]; then
echo -e "\n--Updating AUR Packages--"
if ! "${aur_helper}" -Syu; then
icon_updates_available
echo -e >&2 "\nAn error has occurred\nThe update has been aborted\n" && read -n 1 -r -s -p $'Press \"enter\" to quit\n'
Expand All @@ -192,6 +193,7 @@ update() {
fi

if [ -n "${flatpak_packages}" ]; then
echo -e "\n--Updating Flatpak Packages--"
if ! flatpak update; then
icon_updates_available
echo -e >&2 "\nAn error has occurred\nThe update has been aborted\n" && read -n 1 -r -s -p $'Press \"enter\" to quit\n'
Expand Down Expand Up @@ -225,7 +227,7 @@ orphan_packages() {

case "${answer}" in
[Yy])
echo
echo -e "\n--Removing Orphan Packages--"
pacman -Qtdq | "${su_cmd}" pacman -Rns - && echo -e "\nThe removal has been applied\n" || echo -e >&2 "\nAn error has occurred\nThe removal has been aborted\n"
;;
*)
Expand All @@ -247,7 +249,7 @@ orphan_packages() {

case "${answer}" in
[Yy])
echo
echo -e "\n--Removing Flatpak Unused Packages--"
flatpak remove --unused && echo -e "\nThe removal has been applied\n" || echo -e >&2 "\nAn error has occurred\nThe removal has been aborted\n"
;;
*)
Expand All @@ -274,7 +276,7 @@ pacnew_files() {

case "${answer}" in
[Yy]|"")
echo
echo -e "\n--Processing Pacnew Files--"
"${su_cmd}" pacdiff
echo -e "\nThe pacnew file(s) processing has been applied\n"
;;
Expand Down