Project

General

Profile

« Previous | Next » 

Revision 11784

lib/sh/util.sh: import_vars: don't overwrite vars that are already defined, to allow the caller to specify their own values for the vars to create. this requires callers that rely on the overwriting functionality to reverse the order in which they run use_* commands, so that the higher-precedence use_* is applied first and the other one as the default values for the first.

View differences:

db.sh
8 8
declare $(prefix=ssh_ get_prefix_vars); unset $(prefix=ssh_ get_prefix_vars)'
9 9
alias use_local='declare prefix=local_; import_vars; unset prefix'
10 10
alias use_remote='declare prefix=remote_; import_vars; unset prefix'
11
alias use_local_remote='{ use_local; use_remote; }'
11
alias use_local_remote='{ use_remote; use_local; }'
12 12
	# *must* be run inside a function
13 13
alias use_root='declare prefix=root_; import_vars; unset prefix'
14 14

  

Also available in: Unified diff