4 ms·
you could also just write as if you're writing go: function main { if ! failing_cmd; then log "this fails!" return 1 fi log "this won't log" }
by cjvirtucio 3y ago
you could also just write as if you're writing go:
function main {
if ! failing_cmd; then
log "this fails!"
return 1
fi
log "this won't log"
}
main
I only mention this because there are folks who don't like set -e.