bugfixing

This commit is contained in:
pika 2025-05-24 17:54:22 +02:00
parent ce1bd93b10
commit 277384651a

View file

@ -122,12 +122,15 @@ run-silent() {
# if given an array, it checks if the command is available, and if not - installs all packages in that array one by one
check-and-install() {
local pkglength="${#@}"
local accum=0
local err out
local package_group=("$@")
local pkglength="${#package_group[@]}"
pen grey "Packages to install: $(pen green bold $pkglength)"
line
for pkg in "$@"; do
local accum=0
local err out
for pkg in "${package_group[@]}"; do
# add one to the accum var to display the [$accum/$pkglenght] like [2/8]
((accum++))
local count="[${accum}/${pkglength}]"
@ -139,8 +142,10 @@ check-and-install() {
check "$(pen bold green Installed) $pkg $(pen bold grey $count)"
else
upclear
throw "Something went wrong! Could not install $(pen bold red $pkg) $(pen bold yellow $count)"
throw "Something went wrong! Could not install $(pen bold red $pkg) $(pen bold grey $count)"
line
pen bold yellow "OUTPUT: ${out:-}"
line
echo-error "${err:-}"
fi
else