Skip to content

Commit f5e06c4

Browse files
committed
fixed json output
1 parent e101104 commit f5e06c4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

func/shared_func.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,11 @@ v_json_list() {
10201020
for field in $fields; do
10211021
eval value=$field
10221022

1023+
# Checking if value exists
1024+
if [ ! -z "$value" ]; then
1025+
tpt=yes
1026+
fi
1027+
10231028
# Checking parrent key
10241029
if [ "$j" -eq 1 ]; then
10251030
echo -e "\t\"$value\": {"
@@ -1037,7 +1042,7 @@ v_json_list() {
10371042
done < $conf
10381043

10391044
# If there was any output
1040-
if [ -n "$value" ]; then
1045+
if [ -n "$tpt" ]; then
10411046
echo -e "\t}"
10421047
fi
10431048

0 commit comments

Comments
 (0)