Skip to content

Commit

Permalink
docs(hooks): Add note about the hooks' working directory
Browse files Browse the repository at this point in the history
This documents the current behaviour. For more information:
#78 (comment)
  • Loading branch information
gtramontina committed Jul 11, 2016
1 parent 7d2fa5a commit e64964e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ Add a `config.ghooks` entry in your `package.json` and simply specify which git
}
```

**Note:** _The hooks' working directory is relative to the git root (where you have your `.git` directory). This means that if your package.json is in a subdirectory of your git repo, you'll need to cd into the directory before running any npm scripts. E.g.:_

```json
"pre-commit": "cd path/to/folder && npm run test"
```

## opt-in/out

One of the last things you want is to raise the barrier to contributing to your open source project. So [Andreas Windt](https://github.com/ta2edchimp) developed the [opt-cli](https://npmjs.com/package/opt-cli) package to allow you to turn your hooks into opt-in/out scripts. See this project's [`package.json`](package.json) for an example of how to do that.
Expand Down

0 comments on commit e64964e

Please sign in to comment.