From c6e87872c761085ba46a2013953181691146e744 Mon Sep 17 00:00:00 2001 From: typicode Date: Sat, 12 Oct 2019 03:59:30 +0200 Subject: [PATCH] Update docs --- .github/ISSUE_TEMPLATE.md | 4 ++-- README.md | 7 ++++++- src/installer/gitRevParse.ts | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 81c786d31..e0e885efe 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,8 +1,8 @@ -You can check the [troubleshoot](https://github.com/typicode/husky#troubleshoot) section in the README and run commands with `HUSKY_DEBUG=1` to get additional information. +Before creating an issue, please check the [troubleshoot](https://github.com/typicode/husky#troubleshoot) section in the README and run commands with `HUSKY_DEBUG=1` to get additional information. ```sh $ HUSKY_DEBUG=1 npm install husky --save-dev -$ HUSKY_DEBUG=1 git commit #... +$ HUSKY_DEBUG=1 git commit # ... ``` diff --git a/README.md b/README.md index 4e4bc00d5..a8ca827d0 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ npm install husky --save-dev git commit -m 'Keep calm and commit' ``` -_Existing hooks are kept. Requires Node `>= 8.6.0` and Git `>= 2.13.2`._ +_Existing hooks are kept. Requires Node `>= 8.6.0` and Git `>= 2.13.0`._ __Note__: if you're trying Yarn v2, please install `husky@next`. See [next](https://github.com/typicode/husky/tree/next) branch. @@ -124,6 +124,7 @@ Support this project with your organization. Your logo will show up here with a + [Commits aren't blocked](#commits-arent-blocked) + [Commits are slow](#commits-are-slow) + [Testing husky in a new repo](#testing-husky-in-a-new-repo) + + [ENOENT error 'node_modules/husky/.git/hooks'](#enoent-error-node_moduleshuskygithooks) @@ -324,6 +325,10 @@ npm install husky --save-dev # Make a commit ``` +#### ENOENT error 'node_modules/husky/.git/hooks' + +Verify that your version of Git is `>=2.13.0`. + ## See also * [pkg-ok](https://github.com/typicode/pkg-ok) - Prevents publishing a module with bad paths or incorrect line endings diff --git a/src/installer/gitRevParse.ts b/src/installer/gitRevParse.ts index b8921ad49..618d304be 100644 --- a/src/installer/gitRevParse.ts +++ b/src/installer/gitRevParse.ts @@ -6,6 +6,7 @@ export default function(): { gitCommonDir: string } { // https://github.com/typicode/husky/issues/580 + // https://github.com/typicode/husky/issues/587 const result = execa.sync('git', [ 'rev-parse', '--show-toplevel', @@ -22,7 +23,7 @@ export default function(): { // If we get --absolute-git-dir in the output, // it probably means that an older version of Git has been used. if (gitCommonDir === '--git-common-dir') { - throw new Error('Husky requires Git >= 2.5.1, please update Git') + throw new Error('Husky requires Git >= 2.13.0, please upgrade Git') } return { topLevel, gitCommonDir }