ryanmcgrath / wrench-js

Recursive file operations in Node.js
MIT License
435 stars 71 forks source link

Can't get excludeHiddenUnix or exclude to work with copyDirRecursive #99

Open reggi opened 9 years ago

reggi commented 9 years ago

There's an npm repo I'm trying to copy recursively. I'm trying not to copy hidden unix files like .git and .gitignore and I also want to exclude a build and cache directory. For some reason I can't get any of these options to work.

This still includes hidden files

wrench.copyDirRecursive(appDir, buildDir, {
  excludeHiddenUnix: true,
  forceDelete: true,
}, function(){
  console.log(arguments)
})

As for exclude I've tried

wrench.copyDirRecursive(appDir, buildDir, {
  excludeHiddenUnix: true,
  forceDelete: true,
  exclude: /build|cache/
}, function(){
  console.log(arguments)
})

and

wrench.copyDirRecursive(appDir, buildDir, {
  excludeHiddenUnix: true,
  forceDelete: true,
  exclude: function(){
    console.log(arguments)
    return false
  }
}, function(){
  console.log(arguments)
})

these exclude options seam to do nothing.

Thoughts?