tlatsas / bash-spinner Goto Github PK
View Code? Open in Web Editor NEWDisplay a small progress spinner in bash while running your commands
License: MIT License
Display a small progress spinner in bash while running your commands
License: MIT License
Thanks! This script inspired me to build a progress spinner for some scripts I'm writing.
I have found a few issues though:
stop_spinner
is called immediately after start_spinner
(or some operation completes very quickly), the output gets a bit messed up. This is because stop_spinner
doesn't wait for the spinner job to terminate before writing to the terminal. This can be accomplished with a simple wait ${_sp_pid}
.[[ ! -t 1 ]]
check.I like this spinner. It works better than the previous one I was trying. Three things, thought.
$?
- or, better, "$?"
- to the stop command is not optional.Anyhow: thanks for your work.
$ zsh ./test.sh
sleeping for 2 secs... _spinner:29: unrecognized modifier i'
[DONE]
copying non-existen files... _spinner:29: unrecognized modifier i'
[FAIL]
14:03:13 ~/repo/bash-spinner master ✔
$ echo $SHELL
/bin/zsh
14:03:20 ~/repo/bash-spinner master ✔
$ ./test.sh
sleeping for 2 secs... [\e[1;32mDONE\e[0m]
copying non-existen files... [\e[1;31mFAIL\e[0m]
14:03:30 ~/repo/bash-spinner master ✔
$ zsh ./test.sh
sleeping for 2 secs... _spinner:29: unrecognized modifier i'
[DONE]
copying non-existen files... _spinner:29: unrecognized modifier i'
[FAIL]
14:03:39 ~/repo/bash-spinner master ✔
$ bash ./test.sh
sleeping for 2 secs... [DONE]
copying non-existen files... [FAIL]
Hi,
I love your spinner!
The laws have changed since you first put out this software. It is my understanding that modification, distribution, etc. is not allowed unless expressly mentioned by the author using a license.
Can you please add a simple license (i.e. MIT, APACHE, BSD-2) to this project?
Thanks,
~Apolo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.