1 | MAKEFLAGS += --warn-undefined-variables
|
2 | PATH := node_modules/.bin:$(PATH)
|
3 | SHELL := /bin/bash
|
4 |
|
5 | .SHELLFLAGS := -eu -o pipefail -c
|
6 | .DEFAULT_GOAL := all
|
7 | .DELETE_ON_ERROR:
|
8 | .SUFFIXES:
|
9 |
|
10 | version ?= patch
|
11 |
|
12 | node_modules: package.json
|
13 | @npm prune
|
14 | @npm install
|
15 | @touch node_modules
|
16 |
|
17 | .PHONY: clean
|
18 | clean:
|
19 | @$(RM) -fr node_modules
|
20 | @$(RM) -fr npm-debug.log
|
21 | @$(RM) -fr coverage
|
22 |
|
23 | .PHONY: test
|
24 | test: node_modules
|
25 | tape test/index.js
|
26 |
|
27 | .PHONY: release
|
28 | release:
|
29 | npm version $(version)
|
30 | git push && git push --tags
|
31 | npm publish
|
32 |
|
33 | .PHONY: coverage
|
34 | coverage: node_modules index.js test/index.js node_modules
|
35 | @istanbul cover --report html --print detail ./test/index.js
|
36 | @touch coverage
|
37 |
|
38 | .PHONY: coveralls
|
39 | coveralls: node_modules coverage
|
40 | @istanbul report lcov && (cat coverage/lcov.info | coveralls)
|
41 |
|
42 | .PHONY: travis
|
43 | travis: test coveralls
|