Comparing version 0.6.2 to 0.7.0
{ | ||
"name": "husky", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"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 [![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) | ||
# 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?style=flat)](https://www.npmjs.org/package/husky) | ||
@@ -3,0 +3,0 @@ > husky prevents bad commit or push using Git hooks. |
@@ -1,2 +0,3 @@ | ||
var fs = require('fs') | ||
var fs = require('fs') | ||
var path = require('path') | ||
var exec = require('child_process').exec | ||
@@ -35,5 +36,16 @@ | ||
} | ||
// Assuming that this file is in node_modules/husky/src | ||
var packageDir = path.join(__dirname, '..', '..', '..') | ||
// dir being .git/hooks | ||
var projectDir = path.join(dir, '..', '..') | ||
// In order to support projects with package.json in a different directory | ||
// than .git, find relative path from project directory to package.json | ||
var relativePath = path.join('.', path.relative(projectDir, packageDir)) | ||
data += | ||
'npm run --json | grep -q \'"' + cmd + '":\'\n' // fix for issue #16 | ||
'cd ' + relativePath + '\n' | ||
+ 'npm run --json | grep -q \'"' + cmd + '":\'\n' // fix for issue #16 | ||
+ 'if [ $? -ne 0 ]; then\n' | ||
@@ -40,0 +52,0 @@ + ' exit 0\n' // package.scripts[name] can't be found exit |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6999
127