Skip to content
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

Initial folder structure not restored in destination folder #27

Closed
johannchopin opened this issue Dec 28, 2020 · 3 comments Β· Fixed by #34
Closed

Initial folder structure not restored in destination folder #27

johannchopin opened this issue Dec 28, 2020 · 3 comments Β· Fixed by #34

Comments

@johannchopin
Copy link

Hey πŸ‘‹ First thanks for the effort put in this project πŸ‘

I have a project structure that looks like this:

project
β”‚
└───node_modules
β”‚   └───module
β”‚       └───public
β”‚           └───dist
β”‚               β”‚ styles.css
β”‚           β”‚ index.html
β”‚   
└───src

And I want to copy the public folder from node_modules/module/public into the src/public folder. So I run this command:

$ yarn cpy ./node_modules/module/public ./src/public

It works but the final src/public folder contains all the files but not the initial folder structure:

# just the files
β”‚   
└───src
    └───public
        β”‚ styles.css
        β”‚ index.html
# expected folder structure
β”‚   
└───src
    └───public
        └───dist
            β”‚ styles.css
        β”‚ index.html

And if I run it with the --parents I got this structure:

public
β”‚
└───node_modules
β”‚   └───module
β”‚       └───public
β”‚           └───dist
β”‚               β”‚ styles.css
β”‚           β”‚ index.html

Has someone an idea how I could get the expected folder structure?

Thanks in advance πŸ˜„

@sindresorhus
Copy link
Owner

I think sindresorhus/cpy#77 will resolve your issue.

@JounQin
Copy link

JounQin commented Sep 4, 2021

@sindresorhus

Is the following expected because sindresorhus/cpy#77 has been merged?

cpy node_modules/shiki/{dist,languages,themes} public/shiki --parents

image

@sindresorhus
Copy link
Owner

This is now fixed in cpy, so someone just needs to bring the updates here. https://github.com/sindresorhus/cpy/releases/tag/v9.0.0

@sindresorhus sindresorhus pinned this issue Feb 27, 2022
This was referenced Feb 27, 2022
@sindresorhus sindresorhus unpinned this issue May 12, 2022
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 a pull request may close this issue.

3 participants