mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
dot option in glob for ignore
This commit is contained in:
@@ -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();
|
||||
|
||||
1
test/assets/package-ignorables/.casey
Normal file
1
test/assets/package-ignorables/.casey
Normal file
@@ -0,0 +1 @@
|
||||
Casey Jones
|
||||
@@ -0,0 +1 @@
|
||||
NYC Sewer System
|
||||
@@ -4,6 +4,9 @@
|
||||
"dependencies": {},
|
||||
"ignore": [
|
||||
"test/",
|
||||
"**/*.txt"
|
||||
"**/*.txt",
|
||||
"config/**/*",
|
||||
".casey",
|
||||
"**/turtle-location*"
|
||||
]
|
||||
}
|
||||
|
||||
3
test/assets/package-ignorables/config/.jshintrc
Normal file
3
test/assets/package-ignorables/config/.jshintrc
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"asi": false
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user