Why Nostr? What is Njump?
2024-03-24 16:36:10
in reply to

eisai on Nostr: menherahair If that thing is to be sourced why in the world does it have a shebang, ...

If that thing is to be sourced why in the world does it have a shebang, aaaaaa

Yeah, I agree, that it’s a bad idea to barge in with your stuff in the middle of works. And the reason why “set -e” didn’t work is difficult to figure out without seeing the description of die() and the shell options in the initial script, but some reasons may be speculated about:
 - using ${var:-another_var} removes the possibility to catch an error here, as the “:-” operator is made exactly to avoid an empty variable triggering an error. A substitution to a string that happens to also be empty doesn’t count as an error (since instead of using a potentially empty value you use substitution, hence you must know what you’re doing)
 - the “[[ -z "$*" ]] && die …” construction relies on “die” to perform exit with the “bad” code, since the logical expressions (&&, ||…) lift up the restriction imposed by “set -e”.

Which means that the pipefail never works, because inside the subshell (which is on the left side of the pipe) there’s never an error – thanks to ${…:-…} – and the check on the empty list of arguments (-z "$*") in _eval_user_sequence() is futile because of the logic expression (&&). The die() function should be doing the exit in this situation, but apparently, it cannot?

Author Public Key
npub13nfqcu3kmtp0elthtcdp3865uuvrm3jlyt03cez9elsdleaddh6s85f7eq