Revision 9298
Added by Aaron Marcuse-Kubitza about 11 years ago
lib/runscripts/util.run | ||
---|---|---|
23 | 23 |
|
24 | 24 |
# users can override run_args_cmd to perform other commands (or no commands) |
25 | 25 |
# after the script is read |
26 |
on_exit() { run_args_cmd; } |
|
26 |
on_exit() { test $? -eq 0 || return; run_args_cmd; }
|
|
27 | 27 |
trap on_exit EXIT |
28 | 28 |
|
29 | 29 |
func_override set_paths__util_sh |
lib/sh/util.sh | ||
---|---|---|
488 | 488 |
|
489 | 489 |
run_args_cmd() # runs the command line args command |
490 | 490 |
{ |
491 |
test $? -eq 0 || return |
|
492 | 491 |
eval set -- "$(reverse "${BASH_ARGV[@]}")" |
493 | 492 |
test $# -ge 1 || set -- all |
494 | 493 |
echo_cmd "$top_script" "$@"; "$@" |
Also available in: Unified diff
lib/sh/util.sh: run_args_cmd(): moved test of $? to lib/runscripts/util.run on_exit() since it needs to be performed for all run_args_cmd() functions, not just the default implementation. (this test ensures that no commands are executed if the EXIT trap was encountered due to a parsing/loading error).