From 7c055a32eac63fa5f9f898daaf048e8b18118da8 Mon Sep 17 00:00:00 2001 From: Infinite <165737308+infstate@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:05:19 -0700 Subject: [PATCH 1/2] Add extra check --- core/tabs/system-setup/system-cleanup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/tabs/system-setup/system-cleanup.sh b/core/tabs/system-setup/system-cleanup.sh index 2641a14f..99a8061f 100755 --- a/core/tabs/system-setup/system-cleanup.sh +++ b/core/tabs/system-setup/system-cleanup.sh @@ -23,7 +23,11 @@ cleanup_system() { ;; pacman) "$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm - "$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1 + if pacman -Qtdq > /dev/null 2>&1; then + printf "%b\n" "${YELLOW}Detected Unused Packages. Removing.${RC}" + "$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1 + fi + printf "%b\n" "${RED}No unused packages found. Skipping.${RC}" ;; *) printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}" From 61246c9a2ad40d00442f8baf00c69d594731730d Mon Sep 17 00:00:00 2001 From: Infinite State <165737308+infstate@users.noreply.github.com> Date: Sun, 27 Oct 2024 15:38:33 -0700 Subject: [PATCH 2/2] Update core/tabs/system-setup/system-cleanup.sh Co-authored-by: Adam Perkowski --- core/tabs/system-setup/system-cleanup.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/tabs/system-setup/system-cleanup.sh b/core/tabs/system-setup/system-cleanup.sh index 99a8061f..f52e22eb 100755 --- a/core/tabs/system-setup/system-cleanup.sh +++ b/core/tabs/system-setup/system-cleanup.sh @@ -23,11 +23,7 @@ cleanup_system() { ;; pacman) "$ESCALATION_TOOL" "$PACKAGER" -Sc --noconfirm - if pacman -Qtdq > /dev/null 2>&1; then - printf "%b\n" "${YELLOW}Detected Unused Packages. Removing.${RC}" - "$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null 2>&1 - fi - printf "%b\n" "${RED}No unused packages found. Skipping.${RC}" + "$ESCALATION_TOOL" "$PACKAGER" -Rns $(pacman -Qtdq) --noconfirm > /dev/null || true ;; *) printf "%b\n" "${RED}Unsupported package manager: ${PACKAGER}. Skipping.${RC}"