commit hook moved to repo, closes #15

master
Evgeny Poberezkin 2015-07-21 23:00:31 +01:00
parent 924407177e
commit a2d2705ec9
9 changed files with 22 additions and 9 deletions

View File

@ -203,11 +203,11 @@ npm test
All validation functions are generated using doT templates in dot folder. Templates are precompiled so doT is not a run-time dependency.
`bin/compile_dots` to compile templates to dotjs folder
`bin/compile-dots` to compile templates to dotjs folder
`bin/watch_dots` to automatically compile templates when files in dot folder change
`bin/watch-dots` to automatically compile templates when files in dot folder change
There is pre-commit hook that runs compile_dots and tests.
`bin/git-hook` to install symbolic link to pre-commit hook that will compile templates and run tests when you commit.
## Changes history

3
bin/compile-dots Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
node ./bin/compile-dots.js

View File

@ -1,3 +0,0 @@
#!/usr/bin/env bash
node ./bin/compile_dots.js

7
bin/git-hook Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
hook=.git/hooks/pre-commit
[ -e "$hook" ] || [ -h "$hook" ] && rm $hook
ln -s $(pwd)/bin/pre-commit $hook

6
bin/pre-commit Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e
bin/compile-dots
npm test

2
bin/watch-dots Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
./node_modules/.bin/watch 'node bin/compile-dots.js' ./lib/dot

View File

@ -1,2 +0,0 @@
#!/usr/bin/env bash
./node_modules/.bin/watch 'node bin/compile_dots.js' ./lib/dot

View File

@ -1,6 +1,6 @@
{
"name": "ajv",
"version": "0.6.4",
"version": "0.6.5",
"description": "Another JSON Schema Validator",
"main": "lib/ajv.js",
"scripts": {