mem-fs-editor icon indicating copy to clipboard operation
mem-fs-editor copied to clipboard

Copying hidden files

Open no1melman opened this issue 7 years ago • 2 comments

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.

no1melman avatar Aug 04 '17 10:08 no1melman

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).

laggingreflex avatar Sep 06 '17 20:09 laggingreflex

this.fs.copy(
  from,
  to,
  {
    globOptions: { dot: true }
  }
);

worked for me.

ethancn avatar Aug 09 '22 08:08 ethancn