Project

General

Profile

« Previous | Next » 

Revision 10271

lib/sh/util.sh: moved runscript-related commands to lib/runscripts/util.run because these only apply to runscripts

View differences:

util.run
22 22

  
23 23
if self_not_included; then
24 24

  
25

  
26
#### setup
27

  
28
run_args_cmd() # runs the command line args command
29
{
30
	eval set -- "$(reverse "${BASH_ARGV[@]}")"
31
	test $# -ge 1 || set -- all
32
	echo_cmd "$top_script" "$@"; time "$@"
33
}
34

  
25 35
# users can override run_args_cmd to perform other commands (or no commands)
26 36
# after the script is read
27 37
on_exit() { test $? -eq 0 || return; run_args_cmd; }
......
36 46
}
37 47
set_paths
38 48

  
49

  
50
#### utils
51

  
52
fwd() # usage: subdirs=(...); fwd "$FUNCNAME" "$@"
53
{
54
	echo_func
55
	: "${subdirs?}"
56
	
57
	for subdir in "${subdirs[@]}"; do "$top_dir"/"$subdir"/run "$@"; done
58
}
59

  
39 60
fi

Also available in: Unified diff