Revision 9271
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
449 | 449 |
require_not_exists() # usage: require_not_exists file || return 0 |
450 | 450 |
{ test ! -e "$1" || type=info die "file "$1" already exists, skipping"; } |
451 | 451 |
|
452 |
function to_file() # usage: stdout=... [if_not_exists=1] to_file cmd... |
|
452 | 453 |
# auto-removes a command's output file on error (like make's .DELETE_ON_ERROR) |
453 |
function to_file() # usage: stdout=... [if_not_exists=1] to_file cmd... |
|
454 | 454 |
{ |
455 | 455 |
echo_func; kw_params stdout |
456 | 456 |
: "${stdout?}" |
lib/sh/db.sh | ||
---|---|---|
35 | 35 |
fi # load new aliases |
36 | 36 |
if self_being_included; then |
37 | 37 |
|
38 |
# auto-adds connection/login opts when specified |
|
39 | 38 |
# usage: mysql*() { ...; mysql_cmd "$@"; } (with alias) |
40 | 39 |
function mysql_cmd() # usage: mysql*() { ...; mysql_cmd cmd "$@"; } |
40 |
# auto-adds connection/login opts when specified |
|
41 | 41 |
{ |
42 | 42 |
echo_func |
43 | 43 |
local cmd="$1"; shift |
Also available in: Unified diff
*{.sh,run}: put doc comment on next line when possible, so that the function name always comes before it