From b8963e1609b4ab2e7ec3a460333408e1efc70799 Mon Sep 17 00:00:00 2001 From: MorganGeek Date: Thu, 2 Jul 2020 16:27:08 +0200 Subject: [PATCH] add shell text formating utilities --- dot_zsh_functions | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/dot_zsh_functions b/dot_zsh_functions index fe161ec..029735f 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -265,6 +265,41 @@ function terragrunt_color { -e "s/\( *.*: *\)\(\".*\"\)\( => \)\(\".*\"\)/${YELLOW}\1${RED}\2${BLACK}\3${GREEN}\4${RESET}/" \ -e "s/\( *.*: *\".*\"\)/${GREEN}\1${RESET}/" } + +bold=$(tput bold) +underline=$(tput sgr 0 1) +reset=$(tput sgr0) +purple=$(tput setaf 171) +red=$(tput setaf 1) +green=$(tput setaf 76) +tan=$(tput setaf 3) +blue=$(tput setaf 38) + +header() { + printf "\n${bold}${purple}========== %s ==========${reset}\n" "$@" +} +arrow() { + printf " ➜ $@\n" +} +success() { + printf "${green} ✔ %s${reset}\n" "$@" +} +error() { + printf "${red} ✖ %s${reset}\n" "$@" +} +warning() { + printf "${tan} ➜ %s${reset}\n" "$@" +} +underline() { + printf "${underline}${bold}%s${reset}\n" "$@" +} +bold() { + printf "${bold}%s${reset}\n" "$@" +} +note() { + printf "${underline}${bold}${blue}Note:${reset} ${blue}%s${reset}\n" "$@" +} + function git-project { if [ -d "$REPO_PATH" ]; then REPO_PATH="$(pwd)"