Revision 12713
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/lib/runscripts/util.run | ||
---|---|---|
77 | 77 |
# (instead of as args to the same command, the way runscripts do) |
78 | 78 |
{ echo_func; for cmd in "$@"; do time echo_run "$cmd"; done; } |
79 | 79 |
|
80 |
: "${auto_ignore=}" #usage: auto_ignore=1 .../__.run target_that_might_not_exist |
|
81 |
if test "$auto_ignore"; then |
|
82 |
fallback() # don't generate error that it doesn't exist |
|
83 |
{ echo_func; log_info "ignoring non-existant target: $*"; } |
|
84 |
fi |
|
85 |
|
|
80 | 86 |
# by default, use all subdirs, including .* |
81 | 87 |
if ! isset subdirs; then subdirs=($(enter_top_dir; wildcard. {.,}*/)); fi |
82 | 88 |
clog-- echo_vars subdirs |
... | ... | |
95 | 101 |
alias fwd_self='fwd "$FUNCNAME" "$@"' # usage: target() { ...; fwd_self; } |
96 | 102 |
|
97 | 103 |
: "${auto_fwd=}" # usage: auto_fwd=1; . .../file_including_util.run |
104 |
# must be set *after* auto_ignore's fallback() to overwrite it |
|
98 | 105 |
if test "$auto_fwd"; then |
99 | 106 |
fallback() { echo_func; fwd "$@"; } |
100 | 107 |
fi |
101 | 108 |
|
102 |
: "${auto_ignore=}" #usage: auto_ignore=1 .../__.run target_that_might_not_exist |
|
103 |
if test "$auto_ignore"; then |
|
104 |
fallback() # don't generate error that it doesn't exist |
|
105 |
{ echo_func; log_info "ignoring non-existant target: $*"; } |
|
106 | 109 |
fi |
107 |
|
|
108 |
fi |
Also available in: Unified diff
bugfix: lib/runscripts/util.run: auto_fwd's fallback() must be set after auto_ignore's fallback() to overwrite it (auto_ignore should only apply if an error would otherwise have been generated by the fallback)