mem-fs-editor
Advanced tools
Comparing version 9.0.2 to 9.1.0
@@ -22,4 +22,11 @@ 'use strict'; | ||
const globOptions = {...options.globOptions, nodir: true}; | ||
const diskFiles = globby.sync(fromGlob, globOptions).map(file => path.resolve(file)); | ||
let diskFiles = []; | ||
if (options.noGlob) { | ||
const fromFiles = Array.isArray(fromGlob) ? fromGlob : [fromGlob]; | ||
diskFiles = fromFiles.filter(filepath => fs.existsSync(filepath)); | ||
} else { | ||
const globOptions = {...options.globOptions, nodir: true}; | ||
diskFiles = globby.sync(fromGlob, globOptions).map(file => path.resolve(file)); | ||
} | ||
const storeFiles = []; | ||
@@ -26,0 +33,0 @@ this.store.each(file => { |
{ | ||
"name": "mem-fs-editor", | ||
"version": "9.0.2", | ||
"version": "9.1.0", | ||
"description": "File edition helpers working on top of mem-fs", | ||
@@ -42,3 +42,3 @@ "scripts": { | ||
"jest": "^27.0.6", | ||
"mem-fs": "^2.1.0", | ||
"mem-fs": "^2.2.1", | ||
"sinon": "^11.1.2" | ||
@@ -45,0 +45,0 @@ }, |
@@ -85,2 +85,4 @@ # mem-fs-editor [](https://github.com/SBoudrias/mem-fs-editor/actions?query=workflow%3A%22Node.js+CI%22) [](http://badge.fury.io/js/mem-fs-editor) [](https://coveralls.io/github/SBoudrias/mem-fs-editor) | ||
`options.noGlob` can be used to by bypass glob matching entirely. In that case, `from` will directly match file paths against the file system. | ||
### `#copyAsync(from, to, [options], context[, templateOptions ])` | ||
@@ -87,0 +89,0 @@ |
29106
598
145