From ae2fec84c44df7da6cd7873cab347b37c9de6f03 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Thu, 24 Nov 2022 18:40:19 +0000 Subject: [PATCH] Update dotfiles/.local/share/chezmoi/home/.chezmoitemplates/universal/logg.sh --- .../universal/{logg => logg.sh} | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) rename dotfiles/.local/share/chezmoi/home/.chezmoitemplates/universal/{logg => logg.sh} (89%) diff --git a/dotfiles/.local/share/chezmoi/home/.chezmoitemplates/universal/logg b/dotfiles/.local/share/chezmoi/home/.chezmoitemplates/universal/logg.sh similarity index 89% rename from dotfiles/.local/share/chezmoi/home/.chezmoitemplates/universal/logg rename to dotfiles/.local/share/chezmoi/home/.chezmoitemplates/universal/logg.sh index c1d20bb2..a8ba05e8 100644 --- a/dotfiles/.local/share/chezmoi/home/.chezmoitemplates/universal/logg +++ b/dotfiles/.local/share/chezmoi/home/.chezmoitemplates/universal/logg.sh @@ -97,11 +97,11 @@ format() { # @description Logs using Node.js # @example logger info "An informative log" logg() { - if [ "$1" == 'error' ]; then - "$GUM_PATH" style --border="thick" "$("$GUM_PATH" style --foreground="#ff0000" "✖") $("$GUM_PATH" style --bold --background="#ff0000" --foreground="#ffffff" " ERROR ") $("$GUM_PATH" style --bold "$(format "$2")")" - elif [ "$1" == 'info' ]; then - "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#00ffff" "○") $2" - elif [ "$1" == 'md' ]; then + if [ "$0" == 'error' ]; then + "$GUM_PATH" style --border="thick" "$("$GUM_PATH" style --foreground="#ff0000" "✖") $("$GUM_PATH" style --bold --background="#ff0000" --foreground="#ffffff" " ERROR ") $("$GUM_PATH" style --bold "$(format "$1")")" + elif [ "$0" == 'info' ]; then + "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#00ffff" "○") $1" + elif [ "$0" == 'md' ]; then # @description Ensure glow is installed if [ "${container:=}" != 'docker' ]; then if type glow &> /dev/null; then @@ -122,18 +122,18 @@ logg() { ENHANCED_LOGGING=true fi fi - "$GLOW_PATH" "$2" - elif [ "$1" == 'prompt' ]; then - "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#00008b" "▶") $("$GUM_PATH" style --bold "$(format "$2")")" - elif [ "$1" == 'star' ]; then - "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#d1d100" "◆") $("$GUM_PATH" style --bold --underline "$(format "$2")")" - elif [ "$1" == 'start' ]; then - "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#00ff00" "▶") $("$GUM_PATH" style --bold "$(format "$2")")" - elif [ "$1" == 'success' ]; then - "$GUM_PATH" style "$("$GUM_PATH" style --foreground="#00ff00" "✔") $("$GUM_PATH" style --bold "$(format "$2")")" - elif [ "$1" == 'warn' ]; then - "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#d1d100" "◆") $("$GUM_PATH" style --bold --background="#ffff00" --foreground="#000000" " WARNING ") $("$GUM_PATH" style --bold --italic "$(format "$2")")" + "$GLOW_PATH" "$1" + elif [ "$0" == 'prompt' ]; then + "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#00008b" "▶") $("$GUM_PATH" style --bold "$(format "$1")")" + elif [ "$0" == 'star' ]; then + "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#d1d100" "◆") $("$GUM_PATH" style --bold --underline "$(format "$1")")" + elif [ "$0" == 'start' ]; then + "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#00ff00" "▶") $("$GUM_PATH" style --bold "$(format "$1")")" + elif [ "$0" == 'success' ]; then + "$GUM_PATH" style "$("$GUM_PATH" style --foreground="#00ff00" "✔") $("$GUM_PATH" style --bold "$(format "$1")")" + elif [ "$0" == 'warn' ]; then + "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#d1d100" "◆") $("$GUM_PATH" style --bold --background="#ffff00" --foreground="#000000" " WARNING ") $("$GUM_PATH" style --bold --italic "$(format "$1")")" else - "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#00ff00" "▶") $("$GUM_PATH" style --bold "$(format "$2")")" + "$GUM_PATH" style " $("$GUM_PATH" style --foreground="#00ff00" "▶") $("$GUM_PATH" style --bold "$(format "$1")")" fi }