Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Build accepts version argument #4340

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 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 not provided, process all versions
# If $1 is "latest", process the last-tagged version
# Otherwise, process the specified version
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 All @@ -30,7 +46,7 @@ for filename in $(ls -1 ../../versions/[23456789].*.md | sort -r) ; do
rm $tempfile

if [ $version = $latest ]; then
if [[ ${version} != *"rc"* ]];then
if [[ ${version} != *"rc"* ]]; then
# version is not a Release Candidate
( cd ../../deploy/oas && ln -sf v$version.html latest.html )
latestCopied=v$version
Expand Down