Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 25 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ set -o pipefail
cd "$(dirname "$0")"
DIR=$(pwd)

# The latest required version of Bikeshed. Update this if the build depends on
# new features or bugfixes in Bikeshed.
BIKESHED_LATEST="5.4.0"

# The latest required version of Wattsi. Update this if you change how ./build.sh invokes Wattsi;
# it will cause a warning if Wattsi's self-reported version is lower. Note that there's no need to
# update this on every revision of Wattsi; only do so when a warning is justified.
Expand Down Expand Up @@ -86,7 +90,9 @@ function main {
exit 0
fi

if [[ $USE_BIKESHED != "true" ]]; then
if [[ $USE_BIKESHED == "true" ]]; then
checkBikeshed
else
checkWattsi
ensureHighlighterInstalled

Expand Down Expand Up @@ -747,6 +753,24 @@ Disallow: /review-drafts/" > "$HTML_OUTPUT/robots.txt"
fi
}

# Checks if Bikeshed is available and up to date
# - Arguments: none
# - Output:
# - Will echo any errors and exit the script with error code 1 if the required
# version is not available.
function checkBikeshed {
if hash bikeshed 2>/dev/null; then
BIKESHED_INSTALLED=$(bikeshed --version)
if ! printf "%s\n%s" "$BIKESHED_LATEST" "$BIKESHED_INSTALLED" | sort -V -C; then
echo "Error: bikeshed version $BIKESHED_LATEST or newer is required."
exit 1
fi
else
echo "Error: bikeshed is required."
exit 1
fi
}

# Checks if Wattsi is available and up to date
# - Arguments: none
# - Output:
Expand Down
2 changes: 1 addition & 1 deletion wattsi2bikeshed.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Text Macro: TWITTER htmlstandard
Text Macro: LATESTRD 2025-01
Abstract: HTML is Bikeshed.
Indent: 1
Markup Shorthands: css off
Markup Shorthands: css off, markdown-block off
Complain About: accidental-2119 off, missing-example-ids off
Include MDN Panels: false
</pre>`;
Expand Down
Loading