broccoli-funnel
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -121,3 +121,7 @@ 'use strict'; | ||
if (this.shouldLinkRoots()) { | ||
this._copy(inputPath, this.destPath); | ||
if (fs.existsSync(inputPath)) { | ||
this._copy(inputPath, this.destPath); | ||
} else if (this.allowEmpty) { | ||
mkdirp.sync(this.destPath); | ||
} | ||
} else { | ||
@@ -124,0 +128,0 @@ mkdirp.sync(this._tmpDir); |
{ | ||
"name": "broccoli-funnel", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Broccoli plugin that allows you to filter files selected from an input tree down based on regular expressions.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -161,2 +161,9 @@ # Broccoli Funnel | ||
`allowEmpty` *{Boolean}* | ||
When using `srcDir`/`destDir` options only (aka no filtering via `include`/`exclude` options), if the `srcDir` were missing an error would be thrown. | ||
Setting `allowEmpty` to true, will prevent that error by creating an empty directory at the destination path. | ||
---- | ||
`include` *{Array of RegExps|Glob Strings|Functions}* | ||
@@ -163,0 +170,0 @@ |
@@ -136,2 +136,19 @@ 'use strict'; | ||
}); | ||
it('does not error with input tree at a missing nested source', function() { | ||
var inputPath = path.join(fixturePath, 'dir1'); | ||
var tree = new Funnel(inputPath, { | ||
srcDir: 'subdir3', | ||
allowEmpty: true | ||
}); | ||
builder = new broccoli.Builder(tree); | ||
return builder.build() | ||
.then(function(results) { | ||
var expected = []; | ||
var outputPath = results.directory; | ||
expect(walkSync(outputPath)).to.eql(expected); | ||
}); | ||
}); | ||
}); | ||
@@ -138,0 +155,0 @@ |
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
30887
535
367