Skip to content

Instantly share code, notes, and snippets.

@wallentx
Created May 8, 2024 02:39
Show Gist options
  • Save wallentx/f90a4847cc277228a053e9f2add15bf0 to your computer and use it in GitHub Desktop.
Save wallentx/f90a4847cc277228a053e9f2add15bf0 to your computer and use it in GitHub Desktop.
A deployment bar that takes doodoos while its loading
deploopoo.webm
#!/bin/bash
trap 'tput cnorm; echo' EXIT
tput civis
end=$(($(date +%s) + 15))
spin='⢿⣿⣻⣿⣽⣿⣾⣿⣷⣿⣿⣾⣿⣷⣿⣯⣿⣟⣿⡿⣿⢿⡿⣿'
i=0 sp="" len=24 cnt=0
gr=$(tput setaf 2)
nc=$(tput sgr0)
while [ $(date +%s) -lt $end ]; do
[ $((i % len)) -eq 0 -a $cnt -gt 0 ] && \
sp+=$( [ $((cnt % 2)) -eq 0 ] && echo "." || echo " " )
printf '\r【 Deploying...%s%s%s%s 】' "${gr}" "$sp" "${spin:$i:2}" "${nc}"
i=$(( (i + 2) % len ))
[ $i -eq 0 ] && cnt=$((cnt + 1))
sleep .05
done
printf '\r\e[2K𝘋𝘦𝘱𝘭𝘰𝘺𝘦𝘥!\n' "${gr}" "${nc}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment