Skip to content

Commit

Permalink
chore: fix docs post processing script (#6171)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Jun 7, 2024
1 parent 96ce87b commit d62262e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/apidocs-gen/post-process-for-konghq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ cat "${CRD_REF_DOC}" >> "${POST_PROCESSED_DOC}"
# Turn the linter back on
echo "<!-- vale on -->" >> "${POST_PROCESSED_DOC}"

SED=sed
if [[ $(uname -s) == "Darwin" ]]; then
if gsed --version 2>&1 >/dev/null ; then
SED=gsed
else
echo "GNU sed is required on macOS. You can install it via Homebrew with 'brew install gnu-sed'."
exit 1
fi
fi

# Replace all description placeholders with proper include directives
sed -i -r \
${SED} -i \
's/<!-- \(.*\) description placeholder -->/{% include md\/kic\/crd-ref\/\1_description.md kong_version=page.kong_version %}/' \
"${POST_PROCESSED_DOC}"

0 comments on commit d62262e

Please sign in to comment.