Skip to content

Commit

Permalink
Improve build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
frivoal committed Mar 5, 2023
1 parent 4dad6c2 commit d4bcda8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
52 changes: 31 additions & 21 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,41 @@ set -e
# Run bikeshed. If there are errors, exit with a non-zero code
# Include a warning in the status for topic branches
if [ $1 ] ; then
bikeshed --print=plain -f spec index.bs index.html --md-status-text='<details class=annoying-warning open><summary>This is not the latest Editor’s Draft of the W3C Process.</summary><p>Check the URL, and make sure this is indeed the version you’re looking for. If not, the current Editor’s Draft can be found at <a href="https://www.w3.org/Consortium/Process/Drafts/">https://www.w3.org/Consortium/Process/Drafts/</a></details>'
bikeshed --print=plain -f spec index.bs index.html \
--md-status-text="<details class=annoying-warning open><summary>This is not the latest Editor’s Draft of the W3C Process.</summary>\
<p>This is the “$1” topic branch; make sure this is indeed the one you’re looking for.\
If not, the current Editor’s Draft can be found at\
<a href='https://www.w3.org/Consortium/Process/Drafts/'>https://www.w3.org/Consortium/Process/Drafts/</a>.<br>\
(The <a href=#sotd>Status of this document</a> section may have information about the purpose of this branch.)</details>"
else
bikeshed --print=plain -f spec
fi

# Bikeshed the DoCs as well
for i in issues-*.txt; do
if [ -f $i ]; then
bikeshed --print=plain -f issues-list $i
fi
done

# The out directory should contain everything needed to produce the
# HTML version of the spec. Copy things there if the directory exists.
# Bikeshed the DoCs as well, unless we're on a topic branch
if ! [ $1 ] ; then
for i in issues-*.txt; do
if [ -f $i ]; then
bikeshed --print=plain -f issues-list $i
fi
done
fi

OUT=${1:-out}
# The out/$1 directory needs to contain everything needed
# to publish the HTML version of the spec.
# Copy things there if the directory exists.
# Only copy the actual Process if we're on a topic branch,
# and everything else too (DoCs, snapshots) if we're on the main branch.

if [ -d $OUT ]; then
if [ -d snapshots ]; then
cp -r snapshots $OUT
fi
for i in issues-*.html; do
if [ -f $i ]; then
cp -r $i $OUT
fi
done
cp index.html $OUT
if [ -d out/$1 ]; then
if ! [ $1 ] ; then
if [ -d snapshots ]; then
cp -r snapshots out/$1/
fi
for i in issues-*.html; do
if [ -f $i ]; then
cp -r $i out/$1/
fi
done
fi
cp index.html out/$1/
fi
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if containsElement "$TRAVIS_BRANCH" "${TOPIC_BRANCHES[@]}" ; then
find -maxdepth 1 ! -name . | xargs rm -rf
cd ../..

./compile.sh "out/$TRAVIS_BRANCH"
./compile.sh "$TRAVIS_BRANCH"
else
# Delete all existing contents except .git and topic branches (we will re-create them)
for i in "${TOPIC_BRANCHES[@]}"; do
Expand Down

0 comments on commit d4bcda8

Please sign in to comment.