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

Help converting syntax for package.json script #39

Closed
gregpettit opened this issue May 17, 2022 · 2 comments
Closed

Help converting syntax for package.json script #39

gregpettit opened this issue May 17, 2022 · 2 comments

Comments

@gregpettit
Copy link

gregpettit commented May 17, 2022

I am using this for a build process that is simple enough to live strictly in NPM via scripts in package.json.

I have no problems using the tool when the syntax uses wildcards in directory; for example:

cpy ../../../shared/picker/*.min.js dist/js/vendor/

But it doesn't do anything (nor throw an actual error, mind you) when I try to single out just a specific file like this:

cpy ../../../shared/picker/picker.min.js dist/js/vendor/

I tried understanding how to translate the original API from "cpy", but the samples were Javascript function calls rather than passing arguments in the command line.

Is the single-file method not supported, or am I missing something in my syntax?

@gregpettit
Copy link
Author

I just noticed that at the level of the package.json script, I have shared/picker/picker.min.js

seems to want to maintain everything starting at and including "shared" as a directory structure, and not navigate into dist/js/vendor in the destination. Clearly the single file copy IS supported, and I'm just a numpty who can't figure out the syntax. Any help would be greatly appreciated, but I recognize that this is a PEBCAK.

@gregpettit
Copy link
Author

The solution was just using the --flat option:

cpy ../../../shared/picker/picker.min.js dist/js/vendor/ --flat

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

No branches or pull requests

1 participant