Revision 9561
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
75 | 75 |
|
76 | 76 |
# usage: local cache_key=...; load_cache; \ |
77 | 77 |
# if ! cached; then save_cache value || return; fi; echo_cached_value |
78 |
# cache_key for function inputs: "$(declare -p "$kw_param"...) $*"
|
|
78 |
# cache_key for function inputs: "$(declare -p kw_param...) $*"
|
|
79 | 79 |
alias load_cache='declare cache_var="$(str2varname "${FUNCNAME}___$cache_key")"' |
80 | 80 |
alias cached='isset "$cache_var"' |
81 | 81 |
alias save_cache='set_var "$cache_var"' |
Also available in: Unified diff
bugfix: lib/sh/util.sh: caching: cache_key for function inputs: need to use `declare -p kw_param` instead of "$kw_param" because declare accepts a param name, not value`