-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
55 lines (41 loc) · 1.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
PEG=./node_modules/.bin/peggy
JEST=./node_modules/.bin/jest
COVERALLS=./node_modules/coveralls/bin/coveralls.js
GAIMAN=./bin/compile.js
ROLLUP=./node_modules/.bin/rollup
CAT=cat
CURL=curl
GREP=grep
GIT=git
CD=cd
RM=rm
NPM=npm
URL=`git config --get remote.origin.url`
README_TMP=readme.html
USER=jcubic
REPO=gaiman
.PHONY: test coveralls demo
all: umd.js
parser.js: Makefile ./src/grammar.peg
$(PEG) -o parser.js ./src/grammar.peg
umd.js: parser.js index.js rollup.config.js ./src/banner.js package.json
$(ROLLUP) -c
demo:
$(GAIMAN) -o docs/demo/ examples/demo.gs
test: parser.js
$(JEST) --coverage --testMatch '**/__tests__/*.spec.js'
test-accept-snapshots: parser.js
$(JEST) --coverage --updateSnapshot --testMatch '**/__tests__/*.spec.js'
coveralls:
$(CAT) ./coverage/lcov.info | $(COVERALLS)
publish-beta:
$(GIT) clone $(URL) --depth 1 npm
$(CD) npm && $(NPM) publish --tag beta
$(RM) -rf npm
publish:
$(GIT) clone $(URL) --depth 1 npm
$(CD) npm && $(NPM) publish
$(RM) -rf npm
purge:
$(CURL) -s https://github.com/$(USER)/$(REPO)/blob/master/README.md > $(README_TMP)
$(GREP) -Eo '<img src="[^"]+"' $(README_TMP) | $(GREP) camo | $(GREP) -Eo 'https[^"]+' | xargs -I {} $(CURL) -w "\n" -s -X PURGE {}