Skip to content

Commit 7f3f39e

Browse files
Meta: use Makefile from deploy.sh
Avoids duplication and hopefully keeps strictness consistent. Co-authored-by: Michael[tm] Smith <[email protected]>
1 parent d7570a6 commit 7f3f39e

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
SHELL=/bin/bash
22

33
bs_installed := $(shell command -v bikeshed 2> /dev/null)
4+
node_installed := $(shell command -v node 2> /dev/null)
45
npm_installed := $(shell command -v npm 2> /dev/null)
56
pp_webidl_installed := $(shell npm ls webidl-grammar-post-processor --parseable --depth=0 2> /dev/null)
67

@@ -10,12 +11,15 @@ index.html : index.bs
1011
ifdef bs_installed
1112
bikeshed spec --die-on=warning index.bs
1213
else
14+
ifndef TRAVIS
1315
@echo Can\'t find a local version of Bikeshed. To install it, visit:
1416
@echo
1517
@echo https://github.com/tabatkins/bikeshed/blob/master/docs/install.md
1618
@echo
1719
@echo Trying to build the spec using the online API at: https://api.csswg.org/bikeshed/
1820
@echo This will fail if you are not connected to the network.
21+
@echo
22+
endif
1923
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
2024
--output index.html \
2125
--write-out "%{http_code}" \
@@ -28,11 +32,20 @@ else
2832
exit 22 \
2933
);
3034
endif
35+
ifdef node_installed
36+
node ./check-grammar.js index.html
37+
else ifdef TRAVIS
38+
exit 1
39+
else
40+
@echo You need node for grammer checking.
41+
endif
3142
ifdef pp_webidl_installed
3243
npm run pp-webidl -- --input index.html
3344
else ifdef npm_installed
3445
npm install
3546
npm run pp-webidl -- --input index.html
47+
else ifdef TRAVIS
48+
exit 1
3649
else
3750
@echo You need node.js and npm to apply post-processing. To install it, visit:
3851
@echo

deploy.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ SOURCE_BRANCH="master"
55
TARGET_BRANCH="gh-pages"
66

77
function doCompile {
8-
curl https://api.csswg.org/bikeshed/ -f -F [email protected] > out/index.html
9-
node ./check-grammar.js ./out/index.html
10-
npm run pp-webidl -- --input ./out/index.html
8+
make
9+
mv index.html ./out/index.html
1110
}
1211

1312
# Pull requests and commits to other branches shouldn't try to deploy, just build to verify

0 commit comments

Comments
 (0)