Explanatory blog post for this demo is available on Viget.com
Project Setup via Backbone-Require-Boilerplate-Lite
- Download and install Node.js
- Clone this repository
- On the command line, type
npm install nodemon -g
to install the nodemon library globally. If it complains about user permissions typesudo npm install nodemon -g
. - If you have installed Grunt globally in the past, you will need to remove it first by typing
npm uninstall -g grunt
. If it complains about user permissions, typesudo npm uninstall -g grunt
. - Next, install the latest version of Grunt by typing
npm install -g grunt-cli
. If it complains about user permissions, typesudo npm install -g grunt-cli
. - Navigate inside of the grunt-git-hooks-demo folder and type
npm install
- Next, type
nodemon
(this will start your Node.js web server and restart the server any time you make a file change thanks to the wonderful nodemon library) - To view the demo page, go to
http://localhost:8001
- To view the Jasmine test suite page, go to
http://localhost:8001/specRunner.html
Type grunt githooks
to set up the pre-commit hook specified in Gruntfile.js
. You may also type grunt
since githooks is a default task in this example.