diff --git a/distros.sh b/distros.sh index d4f1950..2ebf229 100755 --- a/distros.sh +++ b/distros.sh @@ -74,7 +74,25 @@ echo_error() { } 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() { @@ -112,21 +130,21 @@ checkAndInstall() { # ─< if it's not a list, then just check and install the package.. >────────────────────── if [ -z "$2" ]; then if ! command_exists "$1"; then - echo_pkg "$1 is not installed. Installing it now.." + echo_pkg deps "Installing $1 .." run _install "$1" else - echo_pkg "skipping $1 - as it's already installed.." + echo_pkg deps "skipping $1 - as it's already installed.." fi else # ─< else go though the list of items and do the same >─────────────────────────────────── echo "${BRIGHT_YELLOW}Installing package group -${BOLD}${RED} $@ ${NC}" for deps in "${@}"; do - echo_pkg "Installing $deps" + echo_pkg deps "Installing $deps" if ! command_exists $deps; then echo_pkg "$deps is not installed. Installing it now.." run _install "$deps" else - echo_pkg "skipping $deps - as it's already installed.." + echo_pkg deps "skipping $deps - as it's already installed.." fi done fi