jonschlinkert / copy

Copy files using glob patterns. Sync, async, promise or streams. (node.js utility)
MIT License
94 stars 125 forks source link

glob pattern does not allow for ignored patterns #10

Closed kenhowardpdx closed 8 years ago

kenhowardpdx commented 8 years ago

I have a case where I want to copy all files out of my src directory except *.ts files. I'd expect the following code to prevent *.ts files from being copied to the destination folder.

copy(['src/**/*', '!src/**/*.ts'], 'dest', function (err, file) {
  // done
});
jonschlinkert commented 8 years ago

try '!**/src/**/*.ts', to ensure the path matches if node-gob makes the pattern absolute.

jonschlinkert commented 8 years ago

closing since the solution I mentioned should work, @kenhowardpdx please reopen if you're stilling having the problem

havenchyk commented 3 years ago

@jonschlinkert it doesn't work for me, could you please reopen?