Skip to content

Commit

Permalink
fixup! Build single targets
Browse files Browse the repository at this point in the history
build.sh with no arguments builds all versions
build.sh <version> builds single version
build.sh latest builds latest version
build.sh src builds from src/oas.md
Resolve Google Analytics snippet location relative to md2html.js
Update tests to reflect inclusion of snippet
Pre-requisite to OAI#4341
  • Loading branch information
duncanbeevers committed Feb 9, 2025
1 parent 9449ce8 commit 639c6ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target
atlassian-ide-plugin.xml
node_modules/
deploy/
deploy-preview/
coverage/
history
Gemfile.lock
17 changes: 9 additions & 8 deletions scripts/md2html/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@
#
# It contains bashisms

if [ -z "$1" ]; then
deploydir="deploy/oas"
else
if [ "$1" = "src" ]; then
deploydir="deploy-preview"
else
deploydir="deploy/oas"
fi

mkdir -p $deploydir/js
mkdir -p $deploydir/temp
cp -p node_modules/respec/builds/respec-w3c.* $deploydir/js/

latest=$(git describe --abbrev=0 --tags)
latestCopied="none"
lastMinor="-"

if [ -z "$1" ]; then
specifications=$(ls -1 versions/[23456789].*.md | grep -v -e "\-editors" | sort -r)
Expand All @@ -35,12 +34,11 @@ else
specifications=$(ls -1 versions/$1.md)
fi

cp -p node_modules/respec/builds/respec-w3c.* $deploydir/js/
latestCopied="none"
lastMinor="-"

for specification in $specifications; do
version=$(basename $specification .md)
minorVersion=${version:0:3}
tempfile="$deploydir/temp/$version.html"

if [ "$1" = "src" ]; then
destination="$deploydir/$version.html"
Expand All @@ -50,6 +48,9 @@ for specification in $specifications; do
maintainers="$(dirname $specification)/$version-editors.md"
fi

minorVersion=${version:0:3}
tempfile="$deploydir/temp/$version.html"

echo === Building $version to $destination

node scripts/md2html/md2html.js --maintainers $maintainers $specification > $tempfile
Expand Down

0 comments on commit 639c6ca

Please sign in to comment.