-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (28 loc) · 846 Bytes
/
Makefile
File metadata and controls
35 lines (28 loc) · 846 Bytes
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
REPORTER = dot
BIN = ./node_modules/.bin
test:
@NODE_ENV=test $(BIN)/mocha tests
test-w:
@NODE_ENV=test $(BIN)/mocha tests \
--reporter $(REPORTER) \
--growl \
--watch
define release
VERSION=`node -pe "require('./package.json').version"` && \
NEXT_VERSION=`node -pe "require('semver').inc(\"$$VERSION\", '$(1)')"` && \
node -e "\
var j = require('./package.json');\
j.version = \"$$NEXT_VERSION\";\
var s = JSON.stringify(j, null, 2);\
require('fs').writeFileSync('./package.json', s);" && \
git commit -m "release $$NEXT_VERSION" -- package.json && \
git tag "$$NEXT_VERSION" -m "release $$NEXT_VERSION"
endef
release-patch: test
@$(call release,patch)
release-minor: test
@$(call release,minor)
release-major: test
@$(call release,major)
# Use PHONY so Makefile knows test is not a directory
.PHONY: test test-w