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

how to specify "root" or "flatten" on the command line #3

Open
garretwilson opened this issue Sep 9, 2018 · 0 comments
Open

how to specify "root" or "flatten" on the command line #3

garretwilson opened this issue Sep 9, 2018 · 0 comments

Comments

@garretwilson
Copy link

Thanks for making this. I'm using jszip-cli in an npm script, and it's working.

I tell jszip to zip up a dist directory, containing a css subdirectory:

jszip -o target/dist.zip dist

Unfortunately the resulting archive contains the actual dist directory as well, that is dist/css. I just want the css directory.

It appears I'm forced to add a separate configuration file!

{
  "entities": [{
    "name": "dist",
    "root": true
  }]
}

Then I have to do this:

jszip -o target/dist.zip --config jzip-dist.json

That seems a lot of trouble just to change the root, not to mention that it clutters up my repository and makes my build configuration more complicated. Would it be possible just to add a --root switch or something similar?

Yes, I know that theoretically each entry could be specified "root" independently, and for such cases, sure, you need a configuration file. But for such an overwhelmingly common use case (just zipping up a single directory), it seems like it would be a great benefit to allow a command line option that would simply assume that all indicated entities would have "root" set to true. (The same could be done for --flatten.)

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