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

Cannot simply copy an entire folder #10

Open
MoOx opened this issue Nov 11, 2016 · 16 comments
Open

Cannot simply copy an entire folder #10

MoOx opened this issue Nov 11, 2016 · 16 comments
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted

Comments

@MoOx
Copy link

MoOx commented Nov 11, 2016

Issuehunt badges

I am getting errors for all folder with this command

cpy test/dist somewhere
Cannot glob `test/dist/folder, test/dist/folder-2`:  EISDIR: illegal operation on a directory, read

I tried

cpy test/dist/**/* somewhere

but same result.

I understand why there is an error, but it's pretty weird to not be able to ignore folder, I would have make this the default behavior.


IssueHunt Summary

Backers (Total: $80.00)

Submitted pull Requests


Become a backer now!

Or submit a pull request to get the deposits!

Tips

@sindresorhus
Copy link
Owner

See: sindresorhus/cpy#10

@meszaros-lajos-gyorgy
Copy link

I've tried the following based on the discussion, that you've linked:

cpy --recursive static public
cpy --recursive static/* public
cpy --recursive static/**/* public
cpy --recursive 'static' 'public'

In every case I've got an error saying: `files` and `destination` required

@meszaros-lajos-gyorgy
Copy link

Tried adding the --recursive after the folders and I've got the same EISDIR error, that MoOx mentioned.

@meszaros-lajos-gyorgy
Copy link

https://www.npmjs.com/package/ncp solved the issue for me.

@indfnzo
Copy link

indfnzo commented Sep 19, 2017

Getting a similar problem. Can't get --recursive to work either.

Context: Using nps with cpy-cli as a dependency of nps-utils. Project is running on Windows.

@kevva
Copy link
Contributor

kevva commented Sep 19, 2017

There's no recursive option, it's just a suggestion in that issue. I think sindresorhus/globby#46 will help this issue move forward.

@indfnzo
Copy link

indfnzo commented Sep 19, 2017

@kevva Yup, found that out eventually. Since I'm calling cpy-cli through nps-utils, I'm moving to nps-utils repository instead to try and find a more direct workaround (use ncp or fs-extra instead of cpy-cli).

@iamstarkov
Copy link

same here,

@JamesCoyle
Copy link

cpy somepath/**/*.* somewhere works for me.

@danielweck
Copy link

cpy somepath/**/. somewhere works for me.

...except the **/*.* file glob selects only filenames with extension, which excludes files like LICENSE, README, etc.
When switching to the **/* glob syntax, the error EISDIR: illegal operation on a directory is raised because the last * matches folder names. Any tips?

@danielweck
Copy link

Ah, so this is already discussed here:
sindresorhus/cpy#40
and:
sindresorhus/cpy#10

...and I see that there is a pending Pull Request to leverage the existing nodir option:
#5

@deadcoder0904
Copy link

deadcoder0904 commented Mar 7, 2019

Did anyone ever found the solution to this?

I need to make cpy-cli copy files (manifest.json) & folder (icons/) cross-platform into dist/. Currently, it only copies files.

I tried this

"scripts": {
    "postbuild": "cpy --recursive 'manifest.json' 'icons/**' 'dist'"
}

But it copies contents of icons/ like so

  • dist
    • icon1.png

But I want to copy the whole folder into dist/ like so

  • dist
    • icons/
      • icon1.png

Any solutions?

@IssueHuntBot
Copy link

@IssueHunt has funded $80.00 to this issue.


@Rowno
Copy link

Rowno commented Apr 25, 2019

@sindresorhus How would you feel about adding an --up flag like the copyfiles package has? This could then be combined with the --parents flag. If it sounds good to you I might implement it.

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
@sindresorhus
Copy link
Owner

@Rowno Sure, if that resolves all the issues mentioned in this thread.

@sgtrusty
Copy link

sgtrusty commented Aug 2, 2021

@sindresorhus How would you feel about adding an --up flag like the copyfiles package has? This could then be combined with the --parents flag. If it sounds good to you I might implement it.

I have started working on fixing this issue by using the previous solution. Let me know if you have any additional tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💵 Funded on Issuehunt This issue has been funded on Issuehunt enhancement help wanted
Projects
None yet
Development

No branches or pull requests