Skip to content

Commit

Permalink
Merge pull request #101 from swcurran/fix-json-too-big
Browse files Browse the repository at this point in the history
  • Loading branch information
amanji authored Nov 20, 2023
2 parents 78e2d08 + c845b20 commit c517912
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/genBundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,12 @@ CAPTUREBASEITEM=$(grep -m 1 '"capture_base": "' ${OCABUNDLE} )
for file in ${JSONFiles}; do
BCKFILE=$(basename ${file}).bck
# Replace the existing "capture_base" JSON item with one from the Excel OCA output
sed "s#.*capture_base.:.*#${CAPTUREBASEITEM}#" ${file} >${BCKFILE}
# and remove the outer array, if present.
sed -e "s#.*capture_base.:.*#${CAPTUREBASEITEM}#" \
-e '1,1 s/\[//' \
-e '$,$ s/]//' ${file} >${BCKFILE}
# Add the overlay to the generated OCA Bundle and out to a temp file
${JQ} ".[].overlays += $(cat ${BCKFILE})" ${OCABUNDLE} > ${TMPOCABUNDLE}
${JQ} --slurpfile filejson ${BCKFILE} ".[].overlays += \$filejson" ${OCABUNDLE} > ${TMPOCABUNDLE}
rm ${BCKFILE}
# Move the tmp file to be the new(est) OCA Bundle file
mv ${TMPOCABUNDLE} ${OCABUNDLE}
Expand Down

0 comments on commit c517912

Please sign in to comment.