dot option in glob for ignore

This commit is contained in:
David DeSandro
2013-01-31 13:54:54 -05:00
parent a8a4f6fd2c
commit ad359e2659
6 changed files with 16 additions and 2 deletions

View File

@@ -272,9 +272,11 @@ Package.prototype.removeLocalPaths = function () {
}.bind(this);
// 1: get paths
var globOpts = { dot: true };
async.forEach(removePatterns, function (removePattern, next) {
// glob path for file path pattern matching
glob(path.join(this.localPath, removePattern), function (err, globPaths) {
var globPattern = path.join(this.localPath, removePattern);
glob(globPattern, globOpts, function (err, globPaths) {
if (err) return this.emit('error', err);
removePaths = removePaths.concat(globPaths);
next();

View File

@@ -0,0 +1 @@
Casey Jones

View File

@@ -0,0 +1 @@
NYC Sewer System

View File

@@ -4,6 +4,9 @@
"dependencies": {},
"ignore": [
"test/",
"**/*.txt"
"**/*.txt",
"config/**/*",
".casey",
"**/turtle-location*"
]
}

View File

@@ -0,0 +1,3 @@
{
"asi": false
}

View File

@@ -447,6 +447,10 @@ describe('package', function () {
assert(!fs.existsSync(pkgInstallPath + 'don.txt'));
assert(!fs.existsSync(pkgInstallPath + 'leo.txt'));
assert(!fs.existsSync(pkgInstallPath + '/test/'));
// ignored dot files
assert(!fs.existsSync(pkgInstallPath + '/config/.jshintrc'));
assert(!fs.existsSync(pkgInstallPath + '.casey'));
assert(!fs.existsSync(pkgInstallPath + '.hide/turtle-location.mdown'));
// this file should still be there
assert(fs.existsSync(pkgInstallPath + 'index.js'));
// all ignore file pattern should be removed