bugfixing
This commit is contained in:
parent
ce1bd93b10
commit
277384651a
1 changed files with 10 additions and 5 deletions
15
dream.sh
15
dream.sh
|
@ -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
|
# 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() {
|
check-and-install() {
|
||||||
local pkglength="${#@}"
|
local package_group=("$@")
|
||||||
local accum=0
|
local pkglength="${#package_group[@]}"
|
||||||
local err out
|
|
||||||
pen grey "Packages to install: $(pen green bold $pkglength)"
|
pen grey "Packages to install: $(pen green bold $pkglength)"
|
||||||
line
|
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]
|
# add one to the accum var to display the [$accum/$pkglenght] like [2/8]
|
||||||
((accum++))
|
((accum++))
|
||||||
local count="[${accum}/${pkglength}]"
|
local count="[${accum}/${pkglength}]"
|
||||||
|
@ -139,8 +142,10 @@ check-and-install() {
|
||||||
check "$(pen bold green Installed) $pkg $(pen bold grey $count)"
|
check "$(pen bold green Installed) $pkg $(pen bold grey $count)"
|
||||||
else
|
else
|
||||||
upclear
|
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:-}"
|
pen bold yellow "OUTPUT: ${out:-}"
|
||||||
|
line
|
||||||
echo-error "${err:-}"
|
echo-error "${err:-}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue