From 606172a7e7ceea88429b4b099296b3a30ee82a10 Mon Sep 17 00:00:00 2001 From: pika Date: Sat, 24 May 2025 00:20:34 +0200 Subject: [PATCH] wip --- dream.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dream.sh b/dream.sh index 34a627d..124450b 100644 --- a/dream.sh +++ b/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