copyfiles icon indicating copy to clipboard operation
copyfiles copied to clipboard

Negate exclude glob

Open internette opened this issue 5 years ago • 4 comments

Currently, the negation pattern for globs is dysfunctional. This is necessary for cases such as file inclusion differences between production and development modes.

Example negation pattern use:

args.indexOf('production') >= 0 ? '!*.min.js' : '*.min.js'

internette avatar Sep 14 '18 19:09 internette

so we do have the exclude option, does that not work ?

calvinmetcalf avatar Sep 14 '18 20:09 calvinmetcalf

@calvinmetcalf the exclude works well with the idea of "exclude anything that contains the substring '.min'" but doesn't seem to work with "exclude anything that doesn't have the substring '.min'"

I have tried '!*.min' with no success and '!(*.min)' throws an error.

internette avatar Sep 14 '18 20:09 internette

we use https://github.com/isaacs/node-glob behind the scenes and the options are passed to them verbatim so it may be an issue in that library possibly related to https://github.com/isaacs/node-glob/issues/231 ?

On Fri, Sep 14, 2018 at 4:42 PM Antoinette Janus [email protected] wrote:

@calvinmetcalf https://github.com/calvinmetcalf the exclude works well with the idea of "exclude anything including the substring '.min'" but doesn't seem to work with "exclude anything that doesn't have the substring '.min'"

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/calvinmetcalf/copyfiles/issues/47#issuecomment-421478740, or mute the thread https://github.com/notifications/unsubscribe-auth/ABE4nzKLmBJwuDL8ZCbxz7IaH5UUnLjhks5ubBSfgaJpZM4Wp2DR .

calvinmetcalf avatar Sep 15 '18 13:09 calvinmetcalf

@calvinmetcalf I figured out the fix for this. I'm going to fork your repo, add a test, update the README with an example, and open a PR

internette avatar Sep 24 '18 19:09 internette