sindresorhus/cpy-cli

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Cannot simply copy an entire folder #10

MoOx posted onGitHub

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.


posted by sindresorhus over 8 years ago

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

posted by meszaros-lajos-gyorgy over 7 years ago

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

posted by meszaros-lajos-gyorgy over 7 years ago

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

posted by meszaros-lajos-gyorgy over 7 years ago

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.

posted by jemhuntr over 7 years ago

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

posted by kevva over 7 years ago

@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).

posted by jemhuntr over 7 years ago

same here,

posted by iamstarkov over 7 years ago

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

posted by JamesCoyle about 7 years ago

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?

posted by danielweck about 7 years ago

Ah, so this is already discussed here: https://github.com/sindresorhus/cpy/issues/40 and: https://github.com/sindresorhus/cpy/issues/10

...and I see that there is a pending Pull Request to leverage the existing nodir option: https://github.com/sindresorhus/cpy-cli/pull/5

posted by danielweck about 7 years ago

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?

posted by deadcoder0904 about 6 years ago

@issuehunt has funded $80.00 to this issue.


posted by IssueHuntBot almost 6 years ago

@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.

posted by Rowno almost 6 years ago

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

posted by sindresorhus almost 6 years ago

@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.

posted by netrules over 3 years ago

Fund this Issue

$80.00
Funded
Only logged in users can fund an issue

Pull requests

Recent activities

netrules submitted an output to  sindresorhus/ cpy-cli# 10
over 3 years ago
issuehunt funded 80.00 for sindresorhus/cpy-cli# 10
almost 6 years ago