Revision 8280
Added by Aaron Marcuse-Kubitza almost 12 years ago
lib/table.run | ||
---|---|---|
9 | 9 |
import () |
10 | 10 |
{ |
11 | 11 |
before_import_cmds |
12 |
echo_run "$(dirname "${BASH_SOURCE[0]}")"/path/to/table.run import
|
|
12 |
"$(dirname "${BASH_SOURCE[0]}")"/path/to/table.run import |
|
13 | 13 |
after_import_cmds |
14 | 14 |
} |
15 | 15 |
|
lib/util.run | ||
---|---|---|
12 | 12 |
|
13 | 13 |
cmd () |
14 | 14 |
{ |
15 |
echo_func "$FUNCNAME" "$@" |
|
15 | 16 |
"$(dirname "${BASH_SOURCE[0]}")"/path_relative_to_self |
16 | 17 |
"$(dirname "${BASH_SOURCE[1]}")"/path_relative_to_caller |
17 | 18 |
"$top_dir"/path_relative_to_outermost_script |
... | ... | |
44 | 45 |
|
45 | 46 |
fwd () |
46 | 47 |
{ |
48 |
echo_func "$FUNCNAME" "$@" |
|
47 | 49 |
for subdir in "${subdirs[@]}"; do |
48 |
echo_run "$(dirname "${BASH_SOURCE[1]}")"/"$subdir"/run "$@"
|
|
50 |
"$(dirname "${BASH_SOURCE[1]}")"/"$subdir"/run "$@" |
|
49 | 51 |
done |
50 | 52 |
} |
51 | 53 |
|
52 |
make () { echo_run env make --directory="$top_dir" "$@"; } |
|
54 |
make () |
|
55 |
{ |
|
56 |
echo_func "$FUNCNAME" "$@" |
|
57 |
echo_run env make --directory="$top_dir" "$@" |
|
58 |
} |
|
53 | 59 |
|
54 | 60 |
if false; then ## usage: |
55 | 61 |
inline_make <<'EOF' |
... | ... | |
60 | 66 |
fi ## |
61 | 67 |
inline_make () |
62 | 68 |
{ |
69 |
echo_func "$FUNCNAME" "$@" |
|
63 | 70 |
(cat |
64 | 71 |
cat <<EOF |
65 | 72 |
|
Also available in: Unified diff
lib/util.run: Echo the command at the beginning of each function using new echo_func, instead of having to type echo_run before every call to a function. Note that because echo_func uses BASH_SOURCE, the path to the file containing the function will be included in the debug message, which greatly facilitates locating which file a command is in.