Comparing version 0.9.1 to 0.9.2
{ | ||
"name": "husky", | ||
"version": "0.9.1", | ||
"version": "0.9.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", |
@@ -36,3 +36,3 @@ var fs = require('fs') | ||
} | ||
// Assuming that this file is in node_modules/husky/src | ||
@@ -43,3 +43,3 @@ var packageDir = path.join(__dirname, '..', '..', '..') | ||
var projectDir = path.join(dir, '..', '..') | ||
// In order to support projects with package.json in a different directory | ||
@@ -51,6 +51,7 @@ // than .git, find relative path from project directory to package.json | ||
'cd ' + relativePath + '\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' | ||
// Fix for issue #16 #24 | ||
// Test if script is defined in package.json | ||
+ '[ -f package.json ] && cat package.json | grep -q \'"' + cmd + '"\\s*:\'\n' | ||
// package.json or script can't be found exit | ||
+ '[ $? -ne 0 ] && exit 0\n' | ||
+ 'npm run ' + cmd + ' --silent\n' | ||
@@ -57,0 +58,0 @@ + 'if [ $? -ne 0 ]; then\n' |
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
7467
147