Skip to content

Implement recursive and flat copy#77

Merged
sindresorhus merged 32 commits intosindresorhus:mainfrom
Idered:feat/recursive-copy
Jul 12, 2021
Merged

Implement recursive and flat copy#77
sindresorhus merged 32 commits intosindresorhus:mainfrom
Idered:feat/recursive-copy

Conversation

@Idered
Copy link
Copy Markdown
Contributor

@Idered Idered commented Aug 30, 2020

Fixes #61
Fixes #84
Fixes #60

  • optimize and refactor
  • update docs
  • add better typescript types
  • write more tests
  • handle rename option
  • copying folders structure
  • flattening file structure
  • current tests passing on windows
  • current tests passing on linux

Examples:

cpy('node_modules', 'web_modules') outputs web_modules/node_modules/module1
node_modules files are copied recursively and structure is preserved.

cpy('node_modules/**', 'web_modules') outputs web_modules/module1
node_modules files are copied recursively and structure is preserved. Only node_modules content will be copied to web_modules.

cpy('node_modules/**', 'web_modules', {flat: true}) outputs web_modules/file1
node_modules files are copied recursively and structure is not preserved. Only node_modules content will be copied to web_modules.

cpy('node_modules/**/*.cmd', 'web_modules') will recreate node_modules structure but all non cmd files will be ommited


IssueHunt Summary

Referenced issues

This pull request has been submitted to:


@sindresorhus
Copy link
Copy Markdown
Owner

@Idered Still interested in finishing this?

@Idered
Copy link
Copy Markdown
Contributor Author

Idered commented Sep 30, 2020

@sindresorhus Sure, I'll tackle it this or next week. From what I remember, it will change behavior a little - results for some patterns won't be compatible with current version - is this ok?

@sindresorhus
Copy link
Copy Markdown
Owner

Yes, I can do a major release.

@sindresorhus
Copy link
Copy Markdown
Owner

@Idered Friendly bump :)

@Idered
Copy link
Copy Markdown
Contributor Author

Idered commented Dec 30, 2020

I've fixed some stuff, now I just need to add docs

Base automatically changed from master to main January 23, 2021 08:54
@sindresorhus
Copy link
Copy Markdown
Owner

Just a friendly reminder in case you forgot about this PR.

@mesqueeb
Copy link
Copy Markdown

@Idered @sindresorhus I'd love to have the copying folders structure feature! Any way I can help?

@sindresorhus
Copy link
Copy Markdown
Owner

Bump :)

@Idered Idered marked this pull request as ready for review June 11, 2021 23:51
@Idered
Copy link
Copy Markdown
Contributor Author

Idered commented Jun 11, 2021

@sindresorhus 👋 I've finished it. I'm skipping refactoring and optimizations. Please let me know if it's any good :)

@mesqueeb
Copy link
Copy Markdown

image

I'd be careful including unrelated commits, it's cognitive strain for the author.

@sindresorhus
Copy link
Copy Markdown
Owner

hey, let me know if you have any feedback.

Sorry for the slow response. It took me a while to get through my notifications...

Copy link
Copy Markdown

@martinpe36 martinpe36 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the version number in package.json be bumped:

"version": "8.1.2" -> "version": "8.1.3"

@sindresorhus
Copy link
Copy Markdown
Owner

Should the version number in package.json be bumped:

Not in a pull request, no.

@philipp-winterle
Copy link
Copy Markdown

@Idered Waiting on this to be fixed. Will you adjust your pr soon?

@sindresorhus sindresorhus merged commit be263e1 into sindresorhus:main Jul 12, 2021
@sindresorhus
Copy link
Copy Markdown
Owner

This looks good now. Thank you for working on this, @Idered.

Do you plan more PRs here or should I do a new release?

@sindresorhus
Copy link
Copy Markdown
Owner

@Idered Did you see #77 (comment) ?

@Josmithr
Copy link
Copy Markdown

Is there an ETA for the new release containing this?

@Idered
Copy link
Copy Markdown
Contributor Author

Idered commented Jul 24, 2021

@sindresorhus hey, sorry for delay. I plan to do some more work on this, please don't release it yet.

@philipp-winterle
Copy link
Copy Markdown

@Idered Not sure you saw this gregnb/filemanager-webpack-plugin#94
Webpack plugin is waiting for cpy to support recursive copy. Since it's a while I would love to have some status updates here.

@sindresorhus
Copy link
Copy Markdown
Owner

@Idered Just wondering if you still plan to work on this as it's been a while and a release is needed.

@Idered
Copy link
Copy Markdown
Contributor Author

Idered commented Oct 4, 2021 via email

@mesqueeb
Copy link
Copy Markdown

@Idered looking forward to it!

@millerds
Copy link
Copy Markdown

millerds commented Dec 3, 2021

Pinging on this again . . .

@millerds
Copy link
Copy Markdown

millerds commented Jan 5, 2022

Any chance this is going to be fixed?

@mesqueeb
Copy link
Copy Markdown

mesqueeb commented Jan 5, 2022

I hope nothing happened to @Idered 😰

@sindresorhus
Copy link
Copy Markdown
Owner

This is continued in #92.

@sindresorhus
Copy link
Copy Markdown
Owner

If anyone wants to help out, fix the things that needs to be addressed in #92 and do a new pull request.

@sindresorhus
Copy link
Copy Markdown
Owner

This is now released: https://github.com/sindresorhus/cpy/releases/tag/v9.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade globby to latest version Support preserving folder structure (recursive) option to preserve folder structure of copied folder

7 participants