Commit a6d6f2b1 authored by Nick Stenning's avatar Nick Stenning

Add NPM scripts to package.json

This serves two purposes:

- The default `npm install && npm test` now suffices to run the test
  suite. This is what Travis and many other systems will do by default
  to build JavaScript projects.

- It removes the need to do $(shell npm bin) hackery in the Makefile.
parent 34be72d3
NPM_BIN := $(shell npm bin)
.PHONY: default
default: all
......@@ -15,14 +13,13 @@ clean:
## Run test suite
.PHONY: test
test: node_modules/.uptodate
$(NPM_BIN)/gulp test-app
npm test
################################################################################
build/manifest.json: node_modules/.uptodate
$(NPM_BIN)/gulp build-app
npm run-script build
node_modules/.uptodate: package.json
@echo installing javascript dependencies
@$(NPM_BIN)/check-dependencies 2>/dev/null || npm install
node_modules/.uptodate:
npm run-script deps 2>/dev/null || npm install
@touch $@
......@@ -134,5 +134,10 @@
},
"hammerjs": "Hammer",
"jquery": "$"
},
"scripts": {
"build": "gulp build-app",
"deps": "check-dependencies",
"test": "gulp test-app"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment