Addet remove question
This commit is contained in:
parent
4cab6852da
commit
8387f4802e
1 changed files with 26 additions and 8 deletions
34
test.sh
34
test.sh
|
@ -33,11 +33,11 @@ spin-get-dependencies() {
|
||||||
# │ You can define dependencies for various linux distros here. It will │
|
# │ You can define dependencies for various linux distros here. It will │
|
||||||
# │ automagically be pulled via the $pkgArray[$distro] variable │
|
# │ automagically be pulled via the $pkgArray[$distro] variable │
|
||||||
# ╰─────────────────────────────────────────────────────────────────────────╯
|
# ╰─────────────────────────────────────────────────────────────────────────╯
|
||||||
depsDebian=(bash zsh curl git neofetch waybar wlogout)
|
depsDebian=(git neofetch waybar wlogout g++ build-essentials)
|
||||||
depsFedora=(bash zsh curl git neofetch waybar wlogout)
|
depsFedora=(git neofetch waybar wlogout)
|
||||||
depsOpensuse=(bash zsh curl git neofetch waybar wlogout)
|
depsOpensuse=(git neofetch waybar wlogout)
|
||||||
depsArch=(bash zsh curl git neofetch waybar wlogout firefox-esr)
|
depsArch=(git neofetch waybar wlogout firefox-esr base-devel)
|
||||||
depsAlpine=(bash zsh curl git neofetch waybar wlogout)
|
depsAlpine=(git neofetch waybar wlogout)
|
||||||
|
|
||||||
# declare -A deplist
|
# declare -A deplist
|
||||||
|
|
||||||
|
@ -112,9 +112,7 @@ spin-get-dependencies() {
|
||||||
main() {
|
main() {
|
||||||
local err out
|
local err out
|
||||||
|
|
||||||
if ! spin-get-dependencies; then
|
if spin-get-dependencies; then
|
||||||
throw "Dependencies could not get generated!"
|
|
||||||
else
|
|
||||||
check "Dependency list generated!"
|
check "Dependency list generated!"
|
||||||
pen red bold "There are ${#deplist[@]} items to install.."
|
pen red bold "There are ${#deplist[@]} items to install.."
|
||||||
# local pkgs="$@"
|
# local pkgs="$@"
|
||||||
|
@ -133,7 +131,27 @@ main() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
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
|
fi
|
||||||
|
|
||||||
# case "$distro" in
|
# case "$distro" in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue