Skip to content

Commit

Permalink
fix: buildUpdates were missing commas
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin authored Aug 6, 2024
1 parent bfbde16 commit 205e64d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions updates/buildUpdates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ for FILE in $(ls ${UPDATES_DIR}/*.json | sort -r); do
COMBINED_DATA+=("\"${FILE_NAME}\": ${FILE_CONTENT}")
done

echo "{" > ${OUTPUT_FILE}

for ((i = 0; i < ${#COMBINED_DATA[@]}; i++)); do
if [ $i -ne 0 ] && [ $i -lt "$((${#COMBINED_DATA[@]} -1))" ]; then
echo "${COMBINED_DATA[$i]}," >> ${OUTPUT_FILE}
else
echo "${COMBINED_DATA[$i]}" >> ${OUTPUT_FILE}
fi
done

echo "}" >> ${OUTPUT_FILE}
{
echo "{"
for ((i = 0; i < ${#COMBINED_DATA[@]}; i++)); do
echo -n " ${COMBINED_DATA[$i]}"
if [ $i -lt "$((${#COMBINED_DATA[@]} - 1))" ]; then
echo ","
else
echo ""
fi
done
echo "}"
} > ${OUTPUT_FILE}

0 comments on commit 205e64d

Please sign in to comment.