Last active
September 20, 2018 19:05
-
-
Save williamhammond/483a62ae2ba6c12141eb27c4562b7ea6 to your computer and use it in GitHub Desktop.
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
function party { | |
if ! command -v figlet; then | |
if ! command -v brew; then | |
echo Requires figlet or brew to be installed | |
return 1 | |
fi | |
brew install figlet | |
fi | |
if [ -z "$1" ]; then | |
echo "Enter party word: " | |
read PARTY_WORD | tr '[:upper:]' '[:lower:]' | |
else | |
PARTY_WORD=$1 | |
fi | |
if [ -z "$2" ]; then | |
echo "Enter party word emoji (without colons): " | |
read WORD_EMOJI | |
else | |
WORD_EMOJI=$2 | |
fi | |
if [ -z "$3" ]; then | |
echo "Enter background emoji (without colons): " | |
read BACKGROUND_EMOJI | |
else | |
BACKGROUND_EMOJI=$3 | |
fi | |
echo | |
figlet -f banner $PARTY_WORD | sed -e "s/#/:$WORD_EMOJI:/g" -e 's/^/ /g' -e "s/ /:$BACKGROUND_EMOJI:/g" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got this working on Ubuntu 16.04 by changing the first part to:
Bonus: I redirected
command -v figlet
andcommand -v brew
STDOUT to /dev/null so that e.g./usr/bin/figlet
doesn't get printed out along with the figlet output, so I can doparty foo bar baz | pbcopy
to copy the output straight to my clipboard.