wip
This commit is contained in:
parent
be5fdade23
commit
606172a7e7
1 changed files with 10 additions and 5 deletions
15
dream.sh
15
dream.sh
|
@ -128,19 +128,23 @@ check-and-install() {
|
|||
if [[ -z $2 ]]; then
|
||||
spin bold yellow "Installing $pkg"
|
||||
if ! command-exists "$pkg"; then
|
||||
if run pkg-install "$pkg"; then
|
||||
if run --err err pkg-install "$pkg"; then
|
||||
upclear
|
||||
check bold "$(pen green bold 'Installed') $pkg"
|
||||
else
|
||||
throw bold red "Error installing $pkg"
|
||||
upclear
|
||||
throw "Something went wrong! Could not install $(pen bold red $pkg)"
|
||||
echo-error "${err:-}"
|
||||
fi
|
||||
else
|
||||
upclear
|
||||
check bold "$pkg $(pen grey bold 'was already installed')"
|
||||
# echo_pkg deps "skipping $pkg - as it's ${RED}already installed.."
|
||||
fi
|
||||
else
|
||||
local pkgs="${#@}"
|
||||
local pkglength="${#@}"
|
||||
# ─< else go though the list of items and do the same >───────────────────────────────────
|
||||
pen grey "Packages to install: $(pen green bold $pkgs)"
|
||||
pen grey "Packages to install: $(pen green bold $pkglength)"
|
||||
for pkg in "$@"; do
|
||||
if ! command-exists $pkg; then
|
||||
spin bold "$(pen bold yellow Installing) $pkg"
|
||||
|
@ -153,7 +157,8 @@ check-and-install() {
|
|||
echo-error "${err:-}"
|
||||
fi
|
||||
else
|
||||
check "$pkg $(pen grey already installed)"
|
||||
upclear
|
||||
check bold "$pkg $(pen grey bold 'was already installed')"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue