Currently we have generator.tarball(), but we should also support zip files.
Could either create a more generalized generator.extract() or an additional generator.zipball(). I would vote for the former.
+1 for generalizing
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?
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.
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.
@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?
I fiddled with this last night and used node-unzip which worked fine. There's also adm-zip but it seems pretty inactive.
Its in the same state, bugged as hell. Though I couldnt find a better one.
That's unfortunate :/ Do you guys know what the specific reservations with it were?
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 ; )
@addyosmani is totally bugged really, e.g.: bower/bower#312
There are a lot more issues than this..
Author does not care anymore
@addyosmani hah, believe me, I would if I could. I'm now waiting on @satazor to get annoyed enough to do it.
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.
Yeah, let's keep this open, but wait and see how Bower works around it ;)
@wibblymat broke: https://github.com/bower/decompress-zip :)
We'll use that one when it's stable enough.
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.
@kevva superexciting :D