sh/jshn.sh: fix json_get_var() and json_get_type() to not return cached values
This commit is contained in:
parent
c0b8aaab1a
commit
0608d12995
1 changed files with 2 additions and 2 deletions
|
@ -95,13 +95,13 @@ json_dump() {
|
|||
json_get_type() {
|
||||
local dest="$1"
|
||||
local var="TYPE_${JSON_CUR}_$2"
|
||||
eval "[ -n \"\${$var+x}\" ] && export -- \"$dest=\${$var}\""
|
||||
eval "export -- \"$dest=\${$var}\"; [ -n \"\${$var+x}\" ]"
|
||||
}
|
||||
|
||||
json_get_var() {
|
||||
local dest="$1"
|
||||
local var="${JSON_CUR}_${2//[^a-zA-Z0-9_]/_}"
|
||||
eval "[ -n \"\${$var+x}\" ] && export -- \"$dest=\${$var}\""
|
||||
eval "export -- \"$dest=\${$var}\"; [ -n \"\${$var+x}\" ]"
|
||||
}
|
||||
|
||||
json_get_vars() {
|
||||
|
|
Loading…
Reference in a new issue