Merged
Conversation
Owner
|
Thanks for working on this. Would you be able to add some tests for the bugs being fixed? |
Owner
✅ |
Contributor
Author
Sure |
sindresorhus
reviewed
Oct 5, 2021
Comment on lines
+66
to
+72
| let collection = []; | ||
| for (const pattern of patterns) { | ||
| collection = [...collection, ...micromatch.braces(pattern, { | ||
| expand: true, | ||
| nodupes: true, | ||
| })]; | ||
| } |
Owner
There was a problem hiding this comment.
This would be a good place to use Array#flatMap.
sindresorhus
requested changes
Oct 5, 2021
| return path.join(options.cwd, destination, path.basename(entry.pattern.originalPath), path.relative(entry.pattern.originalPath, entry.path)); | ||
| } | ||
|
|
||
| if (!entry.pattern.isDirectory && entry.path === entry.relativePath) { |
Owner
There was a problem hiding this comment.
It would be good to have a short code comment on both of these if's on what kind of case they handle.
Owner
|
Bump :) |
9 tasks
sindresorhus
reviewed
Jan 9, 2022
|
It seems this PR introduces a regression. Following is a snippet from the PR original content. Recreate old parents: trueExample directory structure:
Old: New: Output: How should I have the same output as previous Old: cpy('.github/**/*.yml', 'dest', {parents: true})Old Output: New: cpy('.github/**/*.yaml', 'dest')New Output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes 5 bugs:
recursivemode #91This issue can be closed too:
globby.generateGlobTasks#30This PR completes my work on recursive feature
I'm also attaching a small migration guide bellow.
Can I get
hacktoberfest-acceptedlabel on this?Breaking changes & examples
Recursive by default
parentsoption was removedflat: trueoptionExample directory structure:
Command:
cpy('.github/**', 'dest')Old output:
New output:
Recreate old
parents: trueExample directory structure:
Old:
cpy('.github/**', 'dest', {parents: true})New:
cpy('.github', 'dest')Output:
Recreate old
parents: falseExample directory structure:
Old:
cpy('.github/**', 'dest', {parents: false})New:
cpy('.github', 'dest', {flat: true})Output:
Copy all package.json and preserve folder structure
Old:
cpy('node_modules/**/package.json', 'dest', {parents: true})Old output:

New:
cpy('node_modules/**/package.json', 'dest')New output:
