2018-03-21 18:59:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e # halt script on error
|
|
|
|
|
2018-06-24 18:57:24 +00:00
|
|
|
HTMLPROOFER_OPTIONS="./_site --internal-domains=eips.ethereum.org --check-html --check-opengraph --report-missing-names --log-level=:debug --assume-extension --empty-alt-ignore --timeframe=6w --url-ignore=/EIPS/eip-1,EIPS/eip-1,/EIPS/eip-107,/EIPS/eip-858"
|
2018-03-21 18:59:12 +00:00
|
|
|
|
|
|
|
if [[ $TASK = 'htmlproofer' ]]; then
|
2018-03-27 16:24:00 +00:00
|
|
|
bundle exec jekyll doctor
|
|
|
|
bundle exec jekyll build
|
2018-03-21 18:59:12 +00:00
|
|
|
bundle exec htmlproofer $HTMLPROOFER_OPTIONS --disable-external
|
2018-05-17 12:21:03 +00:00
|
|
|
|
|
|
|
# Validate GH Pages DNS setup
|
|
|
|
bundle exec github-pages health-check
|
2018-03-21 18:59:12 +00:00
|
|
|
elif [[ $TASK = 'htmlproofer-external' ]]; then
|
2018-03-27 16:24:00 +00:00
|
|
|
bundle exec jekyll doctor
|
|
|
|
bundle exec jekyll build
|
2018-03-22 00:15:05 +00:00
|
|
|
bundle exec htmlproofer $HTMLPROOFER_OPTIONS --external_only
|
2018-03-27 16:24:00 +00:00
|
|
|
elif [[ $TASK = 'eip-validator' ]]; then
|
2018-05-17 12:21:03 +00:00
|
|
|
BAD_FILES="$(ls EIPS | egrep -v "eip-[0-9]+.md|eip-20-token-standard.md")" || true
|
|
|
|
if [[ ! -z $BAD_FILES ]]; then
|
|
|
|
echo "Files found with invalid names:"
|
|
|
|
echo $BAD_FILES
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-03-21 18:59:12 +00:00
|
|
|
|
2018-06-07 14:14:33 +00:00
|
|
|
FILES="$(ls EIPS/*.md | egrep "eip-[0-9]+.md")"
|
2018-05-17 12:21:03 +00:00
|
|
|
bundle exec eip_validator $FILES
|
2019-05-19 06:54:10 +00:00
|
|
|
elif [[ $TASK = 'codespell' ]]; then
|
|
|
|
codespell -q4 -I .codespell-whitelist eip-X.md EIPS/
|
2018-05-17 12:21:03 +00:00
|
|
|
fi
|