Add zip support #321

Closed
sindresorhus opened this Issue Jul 24, 2013 · 17 comments

Comments

Projects
None yet
5 participants
Owner

sindresorhus commented Jul 24, 2013

Currently we have generator.tarball(), but we should also support zip files.

https://github.com/yeoman/generator/blob/master/lib/actions/fetch.js

Could either create a more generalized generator.extract() or an additional generator.zipball(). I would vote for the former.

Member

passy commented Jul 24, 2013

+1 for generalizing

Owner

addyosmani commented Jul 25, 2013

I would also favour opting for generator.extract(). If I'm correct our current tar dependency won't handle zip extraction but we have a few choices for what would work. Would anyone be opposed to node-zip?

Member

passy commented Jul 25, 2013

What does Bower use nowadays? I remember there were some weird edge cases with one of the formats. I wonder if this would be a good point to pull the complete extraction logic out of the core generator, since we would be adding at least one more dependency.

Owner

addyosmani commented Jul 25, 2013

Bower uses https://github.com/nearinfinity/node-unzip. If they've already done sufficient research work into the edge-cases we could use the unzipping module they are.

Owner

sindresorhus commented Jul 25, 2013

@addyosmani I have reservations about node-unzip as it caused a lot of problems in Bower and the maintainer was unresponsive. Though it might be better now. @satazor u think?

Member

kevva commented Jul 25, 2013

I fiddled with this last night and used node-unzip which worked fine. There's also adm-zip but it seems pretty inactive.

satazor commented Jul 25, 2013

Its in the same state, bugged as hell. Though I couldnt find a better one.

Owner

addyosmani commented Jul 25, 2013

That's unfortunate :/ Do you guys know what the specific reservations with it were?

Owner

addyosmani commented Aug 10, 2013

Just pinging for an update on this. I wouldn't mind us using node-unzip as a stop-gap. I mean..unless @sindresorhus ends up writing an alternative when we're not looking ; )

satazor commented Aug 10, 2013

@addyosmani is totally bugged really, e.g.: bower/bower#312
There are a lot more issues than this..
Author does not care anymore

Owner

sindresorhus commented Aug 10, 2013

@addyosmani hah, believe me, I would if I could. I'm now waiting on @satazor to get annoyed enough to do it.

Owner

addyosmani commented Aug 10, 2013

Would everyone be okay with the resolution on this being: cantfix until we get a better alternative to node-unzip? I would love to have this functionality in the generator system but there appears to be enough concern about current solutions that it makes sense to wait.

Owner

sindresorhus commented Aug 10, 2013

Yeah, let's keep this open, but wait and see how Bower works around it ;)

Owner

sindresorhus commented Aug 16, 2013

@wibblymat broke: https://github.com/bower/decompress-zip :)

We'll use that one when it's stable enough.

Member

kevva commented Aug 17, 2013

Yep, I have a module on its way that'll check if the file is tar, zip, gzip or likewise and choose the right extractor for the job. Will probably use decompress-zip if there aren't any issues.

Owner

sindresorhus commented Aug 17, 2013

@kevva superexciting :D

Member

passy commented Aug 17, 2013

@kevva superxiting!

kevva closed this in a9259ba Sep 30, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment