Skip to content

Commit

Permalink
build: Build accepts version argument
Browse files Browse the repository at this point in the history
`npm run build` continues to build all versions
`npm run build 3.0.0` builds a specific version
`npm run build latest` builds from the latest spec
  • Loading branch information
duncanbeevers committed Feb 6, 2025
1 parent 031d633 commit 6a21745
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions scripts/md2html/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,24 @@ cp -p ../../node_modules/respec/builds/respec-w3c.* ../../deploy/js/
latest=`git describe --abbrev=0 --tags`
latestCopied=none
lastMinor="-"
for filename in $(ls -1 ../../versions/[23456789].*.md | sort -r) ; do
if [[ ${filename} == *-editors.md ]];then

# If $1 is undefined, process all versions
# If $1 is "latest", determine the highest version and process that one
# If $1 is a number, check whether that version exists; report error if no file, otherwise process
if [ -z "$1" ]; then
files=$(ls -1 ../../versions/[23456789].*.md | sort -r)
elif [ "$1" = "latest" ]; then
files="../../versions/$latest.md"
elif [ -f "../../versions/$1.md" ]; then
files="../../versions/$1.md"
else
echo "Error: version $1.md not found"
exit 1
fi

for filename in $files; do

if [[ ${filename} == *-editors.md ]]; then
continue
fi

Expand Down

0 comments on commit 6a21745

Please sign in to comment.