This commit is contained in:
pika 2025-05-18 19:28:05 +02:00
parent 80e3df4257
commit 853d2248c2

View file

@ -74,7 +74,25 @@ echo_error() {
} }
echo_pkg() { echo_pkg() {
echo "${BOLD}${RED}$PACKAGE:${NC}${YELLOW} $1 ${NC}" # if arg 2 does not exist, use normal echo
if [ -z $2 ]; then
echo "${BOLD}${RED}${PACKAGE:-PKG}:${NC}${YELLOW} $1 ${NC}"
else
case "$1" in
build)
echo "${BOLD}${RED}${PACKAGE:-PKG}-build:${NC}${YELLOW} $2 ${NC}"
;;
clone)
echo "${BOLD}${RED}${PACKAGE:-PKG}-clone:${NC}${YELLOW} $2 ${NC}"
;;
deps)
echo "${BOLD}${RED}${PACKAGE:-PKG}-dependencies:${NC}${YELLOW} $2 ${NC}"
;;
*)
echo "${BOLD}${RED}${PACKAGE:-PKG}:${NC}${YELLOW} $1 ${NC}"
;;
esac
fi
} }
echo_info() { echo_info() {
@ -112,21 +130,21 @@ checkAndInstall() {
# ─< if it's not a list, then just check and install the package.. >────────────────────── # ─< if it's not a list, then just check and install the package.. >──────────────────────
if [ -z "$2" ]; then if [ -z "$2" ]; then
if ! command_exists "$1"; then if ! command_exists "$1"; then
echo_pkg "$1 is not installed. Installing it now.." echo_pkg deps "Installing $1 .."
run _install "$1" run _install "$1"
else else
echo_pkg "skipping $1 - as it's already installed.." echo_pkg deps "skipping $1 - as it's already installed.."
fi fi
else else
# ─< else go though the list of items and do the same >─────────────────────────────────── # ─< else go though the list of items and do the same >───────────────────────────────────
echo "${BRIGHT_YELLOW}Installing package group -${BOLD}${RED} $@ ${NC}" echo "${BRIGHT_YELLOW}Installing package group -${BOLD}${RED} $@ ${NC}"
for deps in "${@}"; do for deps in "${@}"; do
echo_pkg "Installing $deps" echo_pkg deps "Installing $deps"
if ! command_exists $deps; then if ! command_exists $deps; then
echo_pkg "$deps is not installed. Installing it now.." echo_pkg "$deps is not installed. Installing it now.."
run _install "$deps" run _install "$deps"
else else
echo_pkg "skipping $deps - as it's already installed.." echo_pkg deps "skipping $deps - as it's already installed.."
fi fi
done done
fi fi