Skip to content

Commit

Permalink
fix(docs): cleaned up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Jan 10, 2016
1 parent aab84ab commit ff40c17
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
npm-debug.log
.DS_Store
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ban-sensitive-files

> Checks filenames to be committed against a library of filename rules to prevent sensitive files in Git
> Checks some files for sensitive contents (for example authToken inside .npmrc file)
[![NPM][ban-sensitive-files-icon] ][ban-sensitive-files-url]

Expand Down Expand Up @@ -33,8 +34,8 @@ Add to your project `npm install --save-dev ban-sensitive-files`

## Use

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

* From NPM script

Expand Down Expand Up @@ -62,16 +63,29 @@ You can check ALL repo filenames again by adding command line flag `-f` to form
}
```

* When using from a CI you probably want to check all filenames `npm run ban -- -f`.
If the CI has troubles running `node --harmony` scripts, set the "ban" script to be exact
* When using from a CI you probably want to check all files in the repo, not just
the changed ones. Pass `-f` or `--all` option. Example Travis file

```yaml
script:
- npm run ban -- --all
- npm test
```
## Note about --harmony flag
If the CI has troubles running `node --harmony` scripts, set the "ban" script to be the full
node command

```json
"scripts": {
"ban": "node --harmony node_modules/.bin/ban"
}
```

* You can use the checker from another module
## Use as a module

You can use the checker from another module

```js
var isBanned = require('ban-sensitive-files');
Expand Down
4 changes: 2 additions & 2 deletions bin/ban.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const checkSensitiveFiles = require('../src/check-sensitive-files')

function shouldCheckAllFiles () {
return process.argv.some(str => {
return str === 'all' ||
str === 'every' ||
return str === '--all' ||
str === '--every' ||
str === '-f' ||
str === '--force'
})
Expand Down

0 comments on commit ff40c17

Please sign in to comment.