Coder Social home page Coder Social logo

bash-spinner's People

Contributors

moul avatar tlatsas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bash-spinner's Issues

great starting point, but found a few issues

Thanks! This script inspired me to build a progress spinner for some scripts I'm writing.

I have found a few issues though:

  • if 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}.
  • all messages are written to stdout, where stderr is usually meant for these sorts of applications. Stdout is a buffered stream, and stderr is not, so stderr will actually work a bit better (less flickering).
  • the script doesn't detect if the output (or error) stream is a terminal. It's probably undesirable to print progress information if the script output is being redirected to a file or another process. You could fix this with a simple [[ ! -t 1 ]] check.

Nice (but . .)

I like this spinner. It works better than the previous one I was trying. Three things, thought.

  1. It would be good to make it clear whether adding a message with the start command is optional.
  2. It would be good to make it totally clear that adding $? - or, better, "$?" - to the stop command is not optional.
  3. I ran your script through the shellEx linter (well, the version of it available for SublimeText; there's a web version too) and it found various things it didn't like. You might want to look at those.

Anyhow: thanks for your work.

Two compatible issues

  • compatible with Zsh

$ zsh ./test.sh
sleeping for 2 secs... _spinner:29: unrecognized modifier i'
[DONE]
copying non-existen files... _spinner:29: unrecognized modifier i'
[FAIL]

  • compatible with *BSD/Mac OS

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]

Can you add a LICENSE?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.