From 8387f4802e21fec4587c6deabffaf015c13cc9e2 Mon Sep 17 00:00:00 2001 From: pika Date: Thu, 22 May 2025 16:07:32 +0200 Subject: [PATCH] Addet remove question --- test.sh | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/test.sh b/test.sh index fc9c204..b1ea364 100755 --- a/test.sh +++ b/test.sh @@ -33,11 +33,11 @@ spin-get-dependencies() { # │ You can define dependencies for various linux distros here. It will │ # │ automagically be pulled via the $pkgArray[$distro] variable │ # ╰─────────────────────────────────────────────────────────────────────────╯ - depsDebian=(bash zsh curl git neofetch waybar wlogout) - depsFedora=(bash zsh curl git neofetch waybar wlogout) - depsOpensuse=(bash zsh curl git neofetch waybar wlogout) - depsArch=(bash zsh curl git neofetch waybar wlogout firefox-esr) - depsAlpine=(bash zsh curl git neofetch waybar wlogout) + depsDebian=(git neofetch waybar wlogout g++ build-essentials) + depsFedora=(git neofetch waybar wlogout) + depsOpensuse=(git neofetch waybar wlogout) + depsArch=(git neofetch waybar wlogout firefox-esr base-devel) + depsAlpine=(git neofetch waybar wlogout) # declare -A deplist @@ -112,9 +112,7 @@ spin-get-dependencies() { main() { local err out - if ! spin-get-dependencies; then - throw "Dependencies could not get generated!" - else + if spin-get-dependencies; then check "Dependency list generated!" pen red bold "There are ${#deplist[@]} items to install.." # local pkgs="$@" @@ -133,7 +131,27 @@ main() { fi done done + check "debug" + else + throw "Dependencies could not get generated!" + exit 69 + fi + if confirm "Do you want to remove all installed packages?"; then + for pkg in "${deplist[@]}"; do + spin bold red "Removing $pkg" + if run --err err --out out pkg-remove "$pkg"; then + check "Removed $pkg" + line + else + check "$pkg could not get removed.." + echo_error "${err:-}" + echo_note "${out:-}" + line + continue + fi + done + check "debug" fi # case "$distro" in