Comparing version 5.0.8 to 5.0.9
@@ -11,2 +11,6 @@ "use strict"; | ||
function install(dir = '.husky') { | ||
if (child_process_1.default.spawnSync('git', ['rev-parse']).status !== 0) { | ||
console.log('husky - not a Git repository, skipping hooks installation'); | ||
return; | ||
} | ||
const absoluteHooksDir = path_1.default.resolve(process.cwd(), dir); | ||
@@ -23,3 +27,6 @@ if (!absoluteHooksDir.startsWith(process.cwd())) { | ||
fs_1.default.copyFileSync(path_1.default.join(__dirname, '../../scripts/husky.sh'), path_1.default.join(dir, '_/husky.sh')); | ||
child_process_1.default.spawnSync('git', ['config', 'core.hooksPath', dir]); | ||
const { error } = child_process_1.default.spawnSync('git', ['config', 'core.hooksPath', dir]); | ||
if (error) { | ||
throw error; | ||
} | ||
} | ||
@@ -26,0 +33,0 @@ catch (e) { |
{ | ||
"name": "husky", | ||
"version": "5.0.8", | ||
"version": "5.0.9", | ||
"description": "Git hooks made easy", | ||
@@ -47,3 +47,3 @@ "bin": "lib/bin.js", | ||
"pretest": "npm run build --silent && npm pack --silent", | ||
"test": "sh ./test/default.sh && sh ./test/sub-dir.sh && sh ./test/config-dir.sh", | ||
"test": "sh ./test/default.sh && sh ./test/sub-dir.sh && sh ./test/config-dir.sh && sh ./test/not-git-dir.sh", | ||
"posttest": "rm husky-*.tgz", | ||
@@ -50,0 +50,0 @@ "commit": "commit" |
@@ -7,10 +7,10 @@ # husky | ||
Husky improves your commits and more 🐶*woof!* | ||
Husky improves your commits and more 🐶 *woof!* | ||
- [**Documentation v5 (recommended for Open Source and Sponsors)**](https://typicode.github.io/husky) | ||
- [Documentation v4 (current latest)](https://github.com/typicode/husky/tree/master) | ||
- [Documentation v4](https://github.com/typicode/husky/tree/master) | ||
**Jan 23, 2021** - 👋 Read husky 5 announcement and see what's new: | ||
__👋 Read husky 5 announcement and see what's new:__ | ||
https://blog.typicode.com/husky-5 | ||
https://dev.to/typicode/what-s-new-in-husky-5-32g5 | ||
@@ -17,0 +17,0 @@ --- |
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
24505
142