From 002d9ff599ab3c3ff5812f0fd7f0bea7131f5bc8 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 30 Dec 2023 14:20:26 +0100 Subject: [PATCH] correct RSS/all.json --- RUNTIME/UPLANET.refresh.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/RUNTIME/UPLANET.refresh.sh b/RUNTIME/UPLANET.refresh.sh index e0c12c98..4bb09089 100755 --- a/RUNTIME/UPLANET.refresh.sh +++ b/RUNTIME/UPLANET.refresh.sh @@ -338,9 +338,12 @@ echo "" > ~/.z data=$(jq '.' "$file") json_array+=("$data") done - # Convert the array to a single JSON object - merged_json=$(jq -n '{"data": [ $json_array[] ]}') - echo "$merged_json" > ~/.zen/tmp/${MOATS}/${UMAP}/RSS/all.json + temp_file=$(mktemp) + printf '%s\n' "${json_array[@]}" > "$temp_file" + # Use jq to read the array from the temporary file and create the merged JSON + jq -n --slurpfile array "$temp_file" '{"data": $array}' > ~/.zen/tmp/${MOATS}/${UMAP}/RSS/all.json + # Remove the temporary file + rm "$temp_file" ############################################################## ############################ PUBLISHING UMAP