jshn: drop json_select warnings when called from json_get_values()

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2014-02-02 15:22:23 +01:00
parent bbd846ec2d
commit 43d2d349cb

View file

@ -206,6 +206,7 @@ json_get_keys() {
json_get_values() { json_get_values() {
local _v_dest="$1" local _v_dest="$1"
local _v_keys _v_val _select= local _v_keys _v_val _select=
local _json_no_warning=1
unset "$_v_dest" unset "$_v_dest"
[ -n "$2" ] && { [ -n "$2" ] && {
@ -267,6 +268,7 @@ json_select() {
_json_set_var JSON_CUR "$cur" _json_set_var JSON_CUR "$cur"
;; ;;
*) *)
[ -n "$_json_no_warning" ] || \
echo "WARNING: Variable '$target' does not exist or is not an array/object" echo "WARNING: Variable '$target' does not exist or is not an array/object"
return 1 return 1
;; ;;