Skip to content

Commit

Permalink
pdate canonical urls in examples to include the version
Browse files Browse the repository at this point in the history
  • Loading branch information
healthedata1 committed Nov 10, 2023
1 parent e73ec76 commit 2e9e0d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,14 @@ if [[ $APP_VERSION ]]; then
tmp=$(mktemp -d -d ./input/_examples)
echo "========= tmp is $tmp ==========="
ver=$(jq -r '.version' fsh-generated/resources/ImplementationGuide*.json)
canon=$(jq -r '.url | split("/ImplementationGuide/")[0]' fsh-generated/resources/ImplementationGuide-hl7.fhir.us.core.json)
echo "========= canon is $canon ==========="
echo "========= current version is $ver ==========="
for file in $examples/*.json
do
# echo "file is $file"
# echo "basename is $(basename $file)"
jq --arg ver "$ver" 'if (.meta.profile) then .meta.profile[0] = .meta.profile[0] + "|"+ $ver else . end' < $file > $tmp/$(basename $file)
jq --arg ver "$ver" --arg canon "$canon" 'if (.meta.profile and (.meta.profile[0] | contains($canon)) ) then .meta.profile[0] = .meta.profile[0] + "|"+ $ver else . end' < $file > $tmp/$(basename $file)

done
mv -f $tmp/*.json $examples
Expand Down

0 comments on commit 2e9e0d5

Please sign in to comment.