Revision 12699
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/lib/runscripts/util.run | ||
---|---|---|
34 | 34 |
include_args=("$@") # from `. .../util.run "$@"` |
35 | 35 |
fi |
36 | 36 |
|
37 |
fallback() { echo_func; "$@"; } # overridable handler for targets w/o function |
|
37 |
fallback() # overridable handler for targets w/o function |
|
38 |
{ echo_func; "$@"; } # by default, generate error that it doesn't exist |
|
38 | 39 |
|
39 | 40 |
gateway() # overridable handler for *all* targets |
40 | 41 |
{ echo_func; if is_callable "$1"; then "$@"; else fallback "$@"; fi; } |
... | ... | |
90 | 91 |
fallback() { echo_func; fwd "$@"; } |
91 | 92 |
fi |
92 | 93 |
|
94 |
: "${auto_ignore=}" #usage: auto_ignore=1 .../__.run target_that_might_not_exist |
|
95 |
if test "$auto_ignore"; then |
|
96 |
fallback() # don't generate error that it doesn't exist |
|
97 |
{ echo_func; log_info "ignoring non-existant target: $*"; } |
|
93 | 98 |
fi |
99 |
|
|
100 |
fi |
Also available in: Unified diff
lib/runscripts/util.run: added $auto_ignore switch, which causes fallback() not to generate an error that a non-existant target doesn't exist