Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature ignorefile #94

Merged
merged 21 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change ignorepath to disable
  • Loading branch information
Vinícius Carvalho committed Sep 8, 2019
commit 94d599958d360d510ed309aa3416cbc7b547161a
2 changes: 1 addition & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var options = {
outpipe: argv.outpipe,
filter: argv.filter && (Array.isArray(argv.filter) ? argv.filter : argv.filter.split(/\W+/)),
awaitWriteFinish: argv['await-write-finish'],
ignorePath: argv['ignore-path'] || './.onchangeignore'
ignorePath: argv['ignore-path']
}

if (!command && !options.outpipe) {
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function onchange (match, command, rawArgs, opts = {}) {
}

function getIgnoreMergedFromIgnoreFile(exclude = [], ignorePath) {
Oak-V marked this conversation as resolved.
Show resolved Hide resolved
if(existsSync(ignorePath)) {
if(ignorePath && existsSync(ignorePath)) {
const ignoreFileString = readFileSync(ignorePath).toString('utf-8')
const ignoreFileArray = ignoreFileString.replace(/^#[^\r\n]+\r?\n/gm, '').split(/\r?\n/)

Expand Down