Comparing version 3.1.0 to 4.0.0
15
index.js
@@ -17,3 +17,3 @@ module.exports = deglob | ||
if (typeof files === 'string') files = [ files ] | ||
if (typeof files === 'string') files = [files] | ||
if (files.length === 0) return nextTick(cb, null, []) | ||
@@ -62,6 +62,7 @@ | ||
configKey: 'config', | ||
gitIgnoreFile: '.gitignore' | ||
gitIgnoreFile: ['.gitignore', '.git/info/exclude'] | ||
}, opts) | ||
if (!opts.cwd) opts.cwd = process.cwd() | ||
if (!Array.isArray(opts.gitIgnoreFile)) opts.gitIgnoreFile = [opts.gitIgnoreFile] | ||
@@ -100,7 +101,11 @@ opts._ignore = [] | ||
// Use ignore patterns from project root .gitignore | ||
var gitignore | ||
var gitignores = [] | ||
try { | ||
gitignore = fs.readFileSync(path.join(root, opts.gitIgnoreFile), 'utf8') | ||
gitignores = opts.gitIgnoreFile.map(function (f) { | ||
return fs.readFileSync(path.join(root, f), 'utf8') | ||
}) | ||
} catch (e) {} | ||
if (gitignore) opts._gitignore.addPattern(gitignore.split(/\r?\n/)) | ||
gitignores.forEach(function (gitignore) { | ||
opts._gitignore.addPattern(gitignore.split(/\r?\n/)) | ||
}) | ||
} | ||
@@ -107,0 +112,0 @@ } |
{ | ||
"name": "deglob", | ||
"description": "Take a list of glob patterns and return an array of file locations, respecting `.gitignore` and allowing for ignore patterns via `package.json`.", | ||
"version": "3.1.0", | ||
"version": "4.0.0", | ||
"author": "Dan Flettre <fletd01@yahoo.com>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7816
119