Created
January 14, 2020 03:44
-
-
Save jorgerance/bd3f7f911b83cf2d85c59ee9a0a75be6 to your computer and use it in GitHub Desktop.
[msgFormatting.sh] output formatting bash helper #bash #helper #script #printf #format #emoji #colors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## Output formatting helper for bash | |
source ~/.env/bash_helpers/vars_colours.sh | |
## Get exit status of process that's piped to another | |
set -o pipefail | |
## fx | |
msg() { | |
printf " ${NO_COLOR}${1}\n" | |
} | |
msg_inverted() { | |
printf "${NO_COLOR}${MSG_INVERTED}${1}${NO_COLOR}\n" | |
} | |
msg_bold() { | |
printf "${NO_COLOR}${BOLD}${1}${NO_COLOR}\n" | |
} | |
msg_err() { | |
printf " 🔥 ${NO_COLOR}${RED}${1}${NO_COLOR}\n" | |
} | |
msg_succ() { | |
printf " 🍻 ${NO_COLOR}${GREEN}${1}${NO_COLOR}\n" | |
} | |
msg_info() { | |
printf " 🌻 ${NO_COLOR}${CYAN}${1}${NO_COLOR}\n" | |
} | |
msg_att() { | |
printf " 🌻 ${NO_COLOR}${YELLOW}${1}${NO_COLOR}\n" | |
} | |
msg_warn() { | |
printf " 🧯 ${NO_COLOR}${YELLOW}${1}${NO_COLOR}\n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment