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

cpy-cli fails to copy a folder recursively #20

Closed
indfnzo opened this issue Sep 19, 2017 · 4 comments · Fixed by #21
Closed

cpy-cli fails to copy a folder recursively #20

indfnzo opened this issue Sep 19, 2017 · 4 comments · Fixed by #21

Comments

@indfnzo
Copy link
Collaborator

indfnzo commented Sep 19, 2017

Can't seem to copy folders with subfolders recursively using the built-in cpy-cli. See sindresorhus/cpy-cli#10.

Project is running on Windows.

@indfnzo
Copy link
Collaborator Author

indfnzo commented Sep 19, 2017

Since apparently, cpy doesn't currently support recursive copying, would it be possible to somehow switch providers from cpy-cli to ncp? Or maybe we could simply create a new util (say, ncopy), referencing ncp via cli.

Another alternative: a wrapper for fs-extra as nps utils.

@indfnzo
Copy link
Collaborator Author

indfnzo commented Sep 19, 2017

Update: I have a working setup with ncopy exported as another utility under nps-utils. I use it like so:

const { series, ncp } = require('nps-utils');

module.exports = {
    scripts: {
        someScript: series(
            ( ... ),
            ncp('dist dist2')
        )
    }
}

This successfully copies all contents of dist onto dist2, including subfolders and files inside subfolders.

If you're fine with this implementation, I can make a PR to get this merged.

@kentcdodds
Copy link
Owner

That looks good to me! Feel free to make a pull request 👍
Be sure to include tests and docs 😀

@kentcdodds
Copy link
Owner

And thank you!

indfnzo pushed a commit to indfnzo/nps-utils that referenced this issue Sep 19, 2017
Adds an alternative util to `copy (cpy-cli)` using `ncp` to allow recursive copying of directories.

closes kentcdodds#20
kentcdodds pushed a commit that referenced this issue Oct 3, 2017
* feat(ncp): add `ncp` which uses `ncp`

Adds an alternative util to `copy (cpy-cli)` using `ncp` to allow recursive copying of directories.

closes #20

* fix(relativeizePaths): escape RegExp to match Windows paths

* fix(relativeizePaths): normalize Windows paths into Unix slashes

* fix(relativeizePaths): fix CI build errors

* fix(relativeizePaths): fix additional CI build errors

* fix(relativeizePaths): fix comma-dangle lint error
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.

2 participants