From 33d931ef3b1d05eaed667dd3fe8deb25479807ad Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Tue, 1 Nov 2022 16:09:04 -0400 Subject: [PATCH] inject maintainer into the metadata --- .github/build-package-pages.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/build-package-pages.sh b/.github/build-package-pages.sh index fdf97fa..8be2bd4 100755 --- a/.github/build-package-pages.sh +++ b/.github/build-package-pages.sh @@ -2,16 +2,17 @@ # cmd: $ ./build-package-pages.sh srcJson targetPath # sample: $ .github/build-package-pages.sh src/data/packages.json src/content/packages' -for row in $(cat $1 | jq -r '.[] | @base64'); do +for row in $(jq -r '.[] | @base64' < "$1"); do _jq() { - echo ${row} | base64 --decode | jq -r ${1} + echo "${row}" | base64 --decode | jq -r "${1}" } - touch $2/$(_jq '.slug').md + touch "$2"/"$(_jq '.slug')".md content="--- type: page title: \"$(_jq '.name')\" +maintainer: \"$(_jq '.maintainer')\" Description: \"$(_jq '.desc' | tr '\"' "'")\" layout: \"package-detail\" ---" - echo "$content" > $2/$(_jq '.slug').md + echo "$content" > "$2"/"$(_jq '.slug')".md done \ No newline at end of file