diff --git a/Makefile b/Makefile index 14a0915..9608fe5 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,13 @@ -all: clean setup test check-checkout-clean +.PHONY: all clean setup -build: - @./node_modules/.bin/npub prep - @./node_modules/.bin/coffee -cbo lib src - -prepublish: - ./node_modules/.bin/npub prep - -clean: - rm -rf lib node_modules - -test: build +all: clean setup npm test -release: all - git push --tags origin HEAD:master - npm publish +clean: + rm -rf node_modules setup: npm install -# This will fail if there are unstaged changes in the checkout -check-checkout-clean: - git diff --exit-code +release-%: clean setup + ./node_modules/.bin/npub publish $(subst release-,,$@) diff --git a/package.json b/package.json index 555d68f..1c1fc96 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,11 @@ "parser" ], "scripts": { - "test": "mocha" + "build": "npub prep && coffee -cbo lib src", + "prepublish": "rm -rf lib && npm run build", + "pretest": "npm run build", + "test": "mocha", + "posttest": "npub verify" }, "author": { "name": "Jan Krems", @@ -17,7 +21,7 @@ "devDependencies": { "assertive": "^1.4.0", "mocha": "^2.0.0", - "npub": "0.0.5" + "npub": "~0.5.1" }, "dependencies": { "coffee-script": "^1.8.0"