Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env bash
- #/
- #|-------------------------------------------------------------------------------
- #| Util Lib for Bash
- #|-------------------------------------------------------------------------------
- #|
- #| Includes:
- #| - Shell color escapes
- #| - Function to print pretty errors for missing bin's
- #|
- #/
- reset='\e[0m'
- bold='\e[1m'
- dim='\e[2m'
- underlined='\e[4m'
- blink='\e[5m'
- inverted='\e[7m'
- hidden='\e[8m'
- default='\e[39m'
- black='\e[30m'
- white='\e[97m'
- red='\e[31m'
- green='\e[32m'
- yellow='\e[33m'
- blue='\e[34m'
- magenta='\e[35m'
- cyan='\e[36m'
- lightGray='\e[37m'
- darkGray='\e[90m'
- lightRed='\e[91m'
- lightGreen='\e[92m'
- lightYellow='\e[93m'
- lightBlue='\e[94m'
- lightMagenta='\e[95m'
- lightCyan='\e[96m'
- bgDefault='\e[49m'
- bgBlack='\e[40m'
- bgWhite='\e[107m'
- bgRed='\e[41m'
- bgGreen='\e[42m'
- bgYellow='\e[43m'
- bgBlue='\e[44m'
- bgMagenta='\e[45m'
- bgCyan='\e[46m'
- bgLightGray='\e[47m'
- bgDarkGray='\e[100m'
- bgLightRed='\e[101m'
- bgLightGreen='\e[102m'
- bgLightYellow='\e[103m'
- bgLightBlue='\e[104m'
- bgLightMagenta='\e[105m'
- bgLightCyan='\e[106m'
- lib_cli_exists () {
- _path=${2:-"$PATH"}
- if ! PATH="$_path" which "$1" &> /dev/null; then
- >&2 printf " ${bgRed}${white}${bold} Error: Could not find '$1' cli on PATH. ${reset}"
- >&2 echo
- PATH="$_path" which "$1" &> /dev/null
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement