From ece673707af25eeb4997030d55d73b23123918be Mon Sep 17 00:00:00 2001 From: "Hunter T." Date: Thu, 5 Dec 2024 10:27:05 -0800 Subject: [PATCH] Output for user's without sudo perms is a warning instead of an error --- run_onchange_install-packages.bash.tmpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/run_onchange_install-packages.bash.tmpl b/run_onchange_install-packages.bash.tmpl index 107276f..fe761cd 100644 --- a/run_onchange_install-packages.bash.tmpl +++ b/run_onchange_install-packages.bash.tmpl @@ -7,6 +7,7 @@ ## Used to colorize output. +C_YELLOW="$(printf '\033[1;33m')" C_GREEN="$(printf '\033[0;32m')" C_BLUE="$(printf '\033[0;34m')" C_CYAN="$(printf '\033[0;36m')" @@ -16,6 +17,7 @@ readonly C_GREEN C_BLUE C_CYAN C_RED C_NC ## Short-hand colorized messages. readonly C_SUCCESS="${C_GREEN}==>${C_NC} " +readonly C_WARNING="${C_YELLOW}==>${C_NC} " readonly C_ERROR="${C_RED}ERROR:${C_NC} " readonly C_INFO="${C_BLUE}==>${C_NC} " readonly C_NOTE="${C_CYAN}==>${C_NC} " @@ -32,8 +34,8 @@ if [[ {{ .chezmoi.os }} == "linux" ]]; then if sudo -l &> /dev/null; then echo "${C_SUCCESS}'${USER}' has permissions to install packages" else - echo "${C_ERROR}'${USER}' does not have permissions to install packages" - echo "${C_INFO}Skipping package installation" + echo "${C_WARNING}'${USER}' does not have permissions to install packages" + echo "${C_INFO}Skipping package installation..." exit fi fi