This package simplifies busy-wait synchronization in the terminal.
Install with npm:
npm install --global guard-cli
Provide a predicate and a payload:
guard ping -c1 google.com && espeak "Attention: the internet is back. This is not a drill"
guard test -e download.tar.gz && dtrx download.tar.gz
For the opposite of guard
, i.e. a command that blocks until condition is not met, use nguard
:
nguard test -e trash && echo Directory removed, deletion complete!
The original (Bash) implementation came from @hershal. Kudos