Revision 8464
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/util.run | ||
---|---|---|
41 | 41 |
test "$#" -ge 1 || set -- all |
42 | 42 |
echo_cmd "$0" "$@"; "$@" |
43 | 43 |
} |
44 |
trap run_cmd EXIT |
|
45 | 44 |
|
45 |
# users can override this function to perform other commands (or no commands) |
|
46 |
# after the script is read |
|
47 |
on_exit () { run_cmd; } |
|
48 |
trap on_exit EXIT |
|
49 |
|
|
46 | 50 |
fwd () # usage: subdirs=(...); fwd "$FUNCNAME" "$@" |
47 | 51 |
{ |
48 | 52 |
echo_func "$@" |
Also available in: Unified diff
lib/util.run: EXIT trap: use on_exit() function which calls run_cmd instead of having run_cmd be the handler, so that users can override this function to perform other commands (or no commands) after the script is read