die: Grab errorcode before doing anything else
This commit is contained in:
parent
386fcc82bd
commit
9cefc87adf
@ -4,9 +4,10 @@
|
||||
# number. Will return instead of exit when the shell is interactive.
|
||||
# Put this in ${fpath} and load it with `autoload -U die`.
|
||||
|
||||
local errorcode=${?}
|
||||
|
||||
setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL
|
||||
|
||||
local errorcode=${?}
|
||||
if [[ -v 1 && ${1} =~ '^[0-9]+$' ]]; then
|
||||
errorcode=${1}
|
||||
shift
|
||||
|
Loading…
x
Reference in New Issue
Block a user