Created
April 18, 2019 07:32
-
-
Save tomfun/4019b58bd1f3c3e5b0b5ed9bc15ae399 to your computer and use it in GitHub Desktop.
Simple bash status updater - preloader
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
#!/usr/bin/env bash | |
i=0 | |
sp='/-\|' | |
n=${#sp} | |
STATUS='Created' | |
while [[ $STATUS == 'InProgress' || $STATUS == 'Created' ]] | |
do | |
sleep 1 | |
# replace echo with real command | |
STATUS=`echo 'InProgress'` | |
MESSAGE=`date "+[%Y-%m-%d %H:%M:%S][$DEPLOY_ENV] - $STATUS"` | |
printf '\r%s' "${MESSAGE} ${sp:i++%n:1}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://giphy.com/gifs/preloadersh-33Hrb7FZfJyV6Y8VEg

.