diff --git a/dream.sh b/dream.sh index 3f0c1f6..8008a60 100644 --- a/dream.sh +++ b/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 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