paxtonhare / demo-magic

A handy shell script that enables you to write repeatable demos in a bash environment.
MIT License
1.68k stars 215 forks source link

Issue with wait not respected #21

Closed embano1 closed 4 years ago

embano1 commented 4 years ago

Using demo-magic on my machine (OSX with zsh or bash) won't respect NO_WAIT, i.e. it will always directly run the commands without waiting for pressing return.

I think the issue is here:

https://github.com/paxtonhare/demo-magic/blob/fc286d6f7adf86804fd207e26d8b1d10ab35b807/demo-magic.sh#L99

This does not test for a boolean true or false expression but whether the variable is set. Explanation from here:

So, basically [ $foo ] will be true if $foo is non-empty. Not true or false, just non-empty. [ ! $foo ] is true if $foo is empty or undefined.

My workaround for now is unset NO_WAIT which then works as expected with the current implementation.