Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-02-02 18:22:23 +0400
committerFelix Fietkau <nbd@openwrt.org>2014-02-02 18:22:23 +0400
commit43d2d349cb86a79d3d86012b101c458d344b05a4 (patch)
tree16a40579dde1c96914a81543abc95f9101e6b30e /sh
parentbbd846ec2d72b2629758b69dc122ac0b0f2c3e4b (diff)
jshn: drop json_select warnings when called from json_get_values()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'sh')
-rw-r--r--sh/jshn.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/sh/jshn.sh b/sh/jshn.sh
index 85c4151..b3cd43c 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -206,6 +206,7 @@ json_get_keys() {
json_get_values() {
local _v_dest="$1"
local _v_keys _v_val _select=
+ local _json_no_warning=1
unset "$_v_dest"
[ -n "$2" ] && {
@@ -267,7 +268,8 @@ json_select() {
_json_set_var JSON_CUR "$cur"
;;
*)
- echo "WARNING: Variable '$target' does not exist or is not an array/object"
+ [ -n "$_json_no_warning" ] || \
+ echo "WARNING: Variable '$target' does not exist or is not an array/object"
return 1
;;
esac