bower / decompress-zip

Module that decompresses zip files
MIT License
102 stars 76 forks source link

Allow filtering #5

Closed satazor closed 10 years ago

satazor commented 11 years ago

To be able to filter symlinks.

See: https://github.com/bower/bower/blob/master/lib/util/extract.js#L40

follow would also be interesting to implement.

wibblymat commented 10 years ago

Filtering is fixed via 705ca19e9843b409b2d01fd3e31285b305753e59

var unzip = new DecompressZip(myFile);
unzip.extract({filter: function (file) {
    return file.type !== 'SymbolicLink';
});

I don't really know what follow would do. I looked to see what node-tar and node-unzip do with a follow option, but it doesn't look like either of those projects support it either.

satazor commented 10 years ago

Follow will follow symlinks instead of interpreting them as symlinks.

wibblymat commented 10 years ago

I'm still confused, I think I'm being dumb here.

Are we talking about symlinks that already exist in the path that we want to output to, or symlinks stored in the zip file? Do you mean that instead of writing out as a symlink we write out a file/folder as appropriate?

satazor commented 10 years ago

I'm talking about zip files with symlinks inside. Yes, if follow is false a symlink is written, otherwise it will interpret that symlink as a regular file writing out a file/folder.

wibblymat commented 10 years ago

Ok, got it. I'll do that today! Created #12 to track it.