Created
July 12, 2016 15:43
-
-
Save jcderr/fc8e42a91d5b46b48572bea46ba7389c to your computer and use it in GitHub Desktop.
(W)ait (U)ntil (C)loud(F)ormation (D)one
This file contains hidden or 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
#!/bin/zsh | |
autoload colors | |
if [[ "$terminfo[colors]" -gt 8 ]]; then | |
colors | |
fi | |
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do | |
eval ${COLOR}='$fg_no_bold[${(L)COLOR}]' | |
eval BOLD_${COLOR}='$fg_bold[${(L)COLOR}]' | |
done | |
function info() { | |
echo "${CYAN}[INFO] ${1}${RESET}" | |
} | |
eval RESET='$reset_color' | |
STACK_NAME=$1 | |
local spinstr='|/-\' | |
local delay=0.75 | |
while [ "$(aws cloudformation describe-stacks --stack-name ${STACK_NAME} --query 'Stacks[].StackStatus' --output text 2> /dev/null | grep -v COMPLETE)" ]; do | |
local temp=${spinstr#?} | |
printf " [%c] " "$spinstr" | |
local spinstr=$temp${spinstr%"$temp"} | |
sleep $delay | |
printf "\b\b\b\b\b\b" | |
done | |
info " _______ ______ .__ __. _______" | |
info "| \\ / __ \\ | \\ | | | ____|" | |
info "| .--. | | | | | \\| | | |__ " | |
info "| | | | | | | | . \` | | __| " | |
info "| '--' | \`--' | | |\\ | | |____ " | |
info "|_______/ \\______/ |__| \\__| |_______|" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment