husky
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -12,8 +12,8 @@ // Run when package is installed | ||
} else { | ||
husky.create(dir, 'pre-commit', 'npm run precommit --silent') | ||
husky.create(dir, 'pre-push', 'npm run prepush --silent') | ||
husky.create(dir, 'post-merge', 'npm run postmerge --silent') | ||
husky.create(dir, 'pre-commit', 'precommit') | ||
husky.create(dir, 'pre-push', 'prepush') | ||
husky.create(dir, 'post-merge', 'postmerge') | ||
console.log(' done\n') | ||
} | ||
}) |
{ | ||
"name": "husky", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
# husky [![NPM version](https://badge.fury.io/js/husky.svg)](http://badge.fury.io/js/husky) [![Build Status](https://travis-ci.org/typicode/husky.svg?branch=master)](https://travis-ci.org/typicode/husky) | ||
# husky [![Build Status](https://travis-ci.org/typicode/husky.svg?branch=master)](https://travis-ci.org/typicode/husky) [![](http://img.shields.io/npm/dm/husky.svg)](https://www.npmjs.org/package/husky) | ||
@@ -16,3 +16,4 @@ > husky prevents bad commit or push using Git hooks. | ||
"precommit": "npm test", | ||
"prepush": "npm test" | ||
"prepush": "npm test", | ||
"postmerge": "npm install" | ||
} | ||
@@ -26,6 +27,6 @@ } | ||
_Both npm scripts are optional, existing hooks aren't replaced and adding `--no-verify` to your git commands lets you bypass hooks._ | ||
_All scripts are optional, existing hooks aren't replaced and adding `--no-verify` to your git commands lets you bypass hooks._ | ||
_To uninstall husky, simply run `npm rm husky --save-dev`_. | ||
_Other supported hook: `post-merge`_ | ||
Missing a Git hook? Feel free to create an [issue](https://github.com/typicode/husky/issues). |
@@ -37,4 +37,8 @@ var fs = require('fs') | ||
data += | ||
cmd + '\n' | ||
'npm run --json | grep -q \'"' + cmd + '":\'\n' // fix for issue #16 | ||
+ 'if [ $? -ne 0 ]; then\n' | ||
+ ' exit 0\n' // package.scripts[name] can't be found exit | ||
+ 'fi\n' | ||
+ 'npm run ' + cmd + ' --silent\n' | ||
+ 'if [ $? -ne 0 ]; then\n' | ||
+ ' echo\n' | ||
@@ -41,0 +45,0 @@ + ' echo "husky - ' + name + ' hook failed (add --no-verify to bypass)"\n' |
6488
118
31