This commit is contained in:
pika 2025-05-22 15:25:15 +02:00
parent f483bf1ab1
commit a29ee9784c

50
test.sh
View file

@ -65,12 +65,8 @@ spin-get-dependencies() {
done done
pkglist=() pkglist=()
pkglist+="$(printf "%s\n" "${deplist[@]}")"
# pkglist=()
# pkglist="${deplist[*]}"
check "pkglist: ${pkglist[*]}" check "pkglist: ${pkglist[*]}"
line
;; ;;
*) *)
echo_error "There are no dependencies to install for $distro" echo_error "There are no dependencies to install for $distro"
@ -79,6 +75,25 @@ spin-get-dependencies() {
esac esac
} }
spin-installation() {
local pkglist="$@"
local pkg err out
line
pen bold green "Starting installation now.."
for pkg in "${pkglist[@]}"; do
spin grey "Installing $pkg"
if run --err err --out out pkg-install $pkg; then
check green "$pkg installed!"
line
else
throw "$pkg was not installed!"
echo_error "${err:-}"
echo_note "${out:-}"
line
fi
done
}
# echo default # echo default
main() { main() {
@ -89,20 +104,17 @@ main() {
else else
check "Dependency list generated!" check "Dependency list generated!"
spin bold yellow "Installing packagelist.. ${pkglist[*]}" spin-installation "${pkglist[@]}"
sleep 3 # spin bold yellow "Installing $pkg"
# if run --err err pkg-install "$pkg"; then
for pkg in "${pkglist[@]}"; do # check "Installed $pkg!"
spin bold yellow "Installing $pkg" # line
if run --err err pkg-install "$pkg"; then # else
check "Installed $pkg!" # throw "$(pen bold blue ${pkglist[*]}) could not get installed!"
line # echo_error "${err:-}"
else # line
throw "$(pen bold blue ${pkglist[*]}) could not get installed!" # fi
echo_error "${err:-}" # done
line
fi
done
fi fi
# case "$distro" in # case "$distro" in