Skip to content

Commit

Permalink
feat(cli): One can use this module from CLI or NPM script
Browse files Browse the repository at this point in the history
closes #3
  • Loading branch information
bahmutov committed Dec 1, 2015
1 parent acd5365 commit 5770f12
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,33 @@ Note: the source file with rules was taken from file
[git-deny-patterns.json](https://github.com/jandre/safe-commit-hook/blob/master/git-deny-patterns.json)
from repo [jandre/safe-commit-hook](https://github.com/jandre/safe-commit-hook) on Dec 2015.

## Install

Add to your project `npm install --save-dev ban-sensitive-files`

## Use

* From the command line `node node_modules/.bin/ban` when you have any staged files to check their
filenames.

* From NPM script

"scripts": {
"ban": "ban"
}

* When using from other Git hook projects, for example from [pre-git](https://github.com/bahmutov/pre-git),
add to the `pre-commit` command list

"config": {
"pre-git": {
"pre-commit": [
"npm test",
"ban"
]
}
}

### Small print

Author: Gleb Bahmutov © 2015
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"version": "0.0.0-semantic-release",
"scripts": {
"test": "mocha src/*-spec.js",
"ban": "node bin/ban.js",
"commit": "git-issues && commit-wizard",
"issues": "git-issues",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
Expand Down Expand Up @@ -43,7 +44,8 @@
"pre-git": {
"commit-msg": "validate-commit-msg",
"pre-commit": [
"npm test"
"npm test",
"node bin/ban.js"
],
"pre-push": [],
"post-commit": [],
Expand Down

0 comments on commit 5770f12

Please sign in to comment.