Skip to content

Commit

Permalink
tweak --ignore option and tests/documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bkp7 committed Feb 7, 2018
1 parent 1c42ebe commit 99191ef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The above two files are included as part of the package and can be copied to you

## Running mdprepare

From the command line run `mdprepare` which will process all md files in the current and any child folders (ignoring the node_modules folder). Alternatively can be fired from any script in package.json. For a full explanation of all the options see [mdprocess Command](#mdprepare-command)
From the command line run `mdprepare` which will process all md files in the current and any child folders (ignoring the node_modules folder). Alternatively can be fired from any script in package.json. For a full explanation of all the options see [mdprepare Command](#mdprepare-command)

## Insertion methods

Expand Down Expand Up @@ -103,7 +103,7 @@ Usage: `mdprepare [FILES] [options]`
`FILES` is a glob expression representing the files to be processed - default: `./**/*.md`

Options:
`--ignore` glob expression representing files to be ignored - default value: `node_modules`
`--ignore` glob expression representing files to be ignored - default values: `node_modules` and the contents of .gitignore if present. eg. `mdprepare --ignore=test*.md`
`--clear` removes any existing text which would normally be replaced by mdprocess.

### mdpInsert Command
Expand Down
1 change: 1 addition & 0 deletions src/processFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function processText (txt, clear, fileDirName) {
} else {
// we are clearing any content so remove all lines between the start and end lines
if (txt.substr(frm, 1) === '\r') { frm++ }
/* istanbul ignore if */
if (txt.substr(frm, 1) === '\n') { frm++ }
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@
describe('mdprepare', function () {
it('fires and returns "processed x files message (1)"', function (done) {
this.timeout(8000)
exec('mdprepare --ignore **/*.md', function (error, stdout, stderr) {
exec('mdprepare --ignore=**/*.md', function (error, stdout, stderr) {
assert.ifError(error)
assert.notEqual(stdout.toString().indexOf('processed '), -1)
assert.notEqual(stdout.toString().indexOf('processed 0 files'), -1)
done()
})
})
Expand Down

0 comments on commit 99191ef

Please sign in to comment.