mem-fs-editor
mem-fs-editor copied to clipboard
Copying hidden files
I have setup a copy like so:
const copyObj = {
src: '*.*',
dest: './',
copyOptions: {
ignore: 'index.html',
dot: true
}
};
fs.copy(
this.templatePath(copyObj.src),
this.destinationPath(copyObj.dest),
copyObj.copyOptions || null
);
The files are these:
const files = [ 'index.js', 'index.html', '.babelrc' ];
So, .babelrc
doesn't ever get copied. I know the glob pattern works - I have tests around this. But for some reason the copy isn't copying them.
Was having a similar problem but with copyTpl. What worked for me was:
this.fs.copyTpl(
from,
to,
{}, // context
{}, // templateOptions
{ globOptions: {dot: true} }
)
So basically your copyOptions
needs to be {globOptions: copyOptions}
(probably).
this.fs.copy(
from,
to,
{
globOptions: { dot: true }
}
);
worked for me.