-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to ignore/exclude a file or folder? #24
Comments
Other tricks might be necessary for particular situations; unfortunately no better example comes to my mind at the moment. Still these two examples could be useful in the ReadMe; the link above would be enough, though. And I agree with you: it took some effort to understand how to to this thing the first time. |
In my src directory I have a folder which I don't want to copy. I'm unable to exclude it with the ! option. Can you help me out with that? |
Try to use |
Same here, I want to copy everything from |
Try with |
Nothing that I tried worked, so I actually found and switched to https://github.com/sindresorhus/cpy, since it allows to pass more than one glob. |
i am facing the same issue too , trying to copy everything except 1 folder and 1 file but does not seems to work with anyone manage to solve it? |
This pattern work: "src/**/!(test)/**/*.!(test.ts)"
/src/style/kit.scss it will select only /src/style/kit.scss here an image that show my testing: |
Failed to get it to ignore a directory also. Looks like this package is missing an option to pass through the |
For some reason, directory ignoring only works if the rest of the pattern can match a specific pattern. Like, with a folder that is |
Finally hit a situation where this bit me today, so I thought I'd post the solution for more complicated scenarios. The above works for files like 'src/main/webapp/blah.ts' but does not for 'src/main/webapp/blah.extra.ts' due to the extra '.' character. I ended up using this matcher which is more general:
The key difference is just putting a wildcard in that parens before the endings you're trying to exclude, that way multiple '.' characters won't accidentally get included. |
I need to do the same, just exlude a 1 or 2 folders inside the src directory.. Looks there is not proper answer yet.. |
In the end I solved it like this, it's complex, but it works for me:
package.json
check-folder-remove.sh
compress-images.js
I haven't found a better way, I hope this will help someone. :) |
Just leaving a note here in case it helps someone in the future as it's the main result that comes up in Google. My issue was that I wanted to copy everything except So to copy all files without a specific extension, but including files that do not have an extension, the syntax should look something like this:
Note, however, that this still doesn't copy files that start with |
I'm looking for a way to ignore a file or folder during the copy. For instance, if I want to copy all js files in a folder except a particular one. I haven't seen any examples or syntax that uses the ! option that minimatch and most other glob matchers use.
The text was updated successfully, but these errors were encountered: