akordowski / Cake.Compression

A Cake AddIn which provides compression functionality for BZip2, GZip and Zip.
MIT License
9 stars 9 forks source link

GZip without TAR #14

Open richardgavel opened 6 years ago

richardgavel commented 6 years ago

I was struggling with why my GZIP wasn't working as expected until I read the source code and realized you both TAR AND GZIP the files. The problem is my files are already in a TAR (It's a save of a Docker image, which is output as a TAR). Seems kinda of weird that you do both by default. Is there a way to allow GZIP without TAR? I know doing this by default would be a breaking change.

akordowski commented 6 years ago

@richardgavel I'm sorry you facing issues with the AddIn. I created the combined way to provide a convinent way to create a GZip archive. But looking at your case, that was not so smart. Unfortunatly I can't provide at the moment a quick solution for your issue. I have to look deeper at it .

richardgavel commented 6 years ago

At the moment, it was quickest to just call 7zip.exe, so I'm not blocked. I know I could have also done the C# code to GZIP it too and probably will.

akordowski commented 6 years ago

Glad to hear you have found a solution. But anyway, thank you for the hint and I will try to solve the issue.

richardgavel commented 6 years ago

One option, there technically is no overload of the GZipCompress alias that takes in a single FilePath as the input. I had to use the IEnumerable with one entry. You could that alias and skip the TAR if the single FilePath is a TAR file (Or just fail if not a TAR file)...Anytime you're specifying more than one file, by definition those files could still be TARred together.

akordowski commented 6 years ago

Yes, I had also the idea. But the Uncompres() method would be not the same, because there I can't determine if the archive contains a Tar file. But if it were a help for you I could implement the workaround.

richardgavel commented 6 years ago

Yeah, good point. I didn't think of the corresponding uncompress method since all I needed was the compress step.

On Wed, Mar 14, 2018, 10:11 AM Artur Kordowski notifications@github.com wrote:

Yes, I had also the idea. But the Uncompres() method would be not the same, because there I can't determine if the archive contains a Tar file. But if it were a help for you I could implement the workaround.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/akordowski/Cake.Compression/issues/14#issuecomment-373056697, or mute the thread https://github.com/notifications/unsubscribe-auth/ADsqD91QkoZl4jCK1CFEsU47mgYm4yWeks5teTMvgaJpZM4SpO9F .

PulsarFX commented 4 years ago

This behaviour drove me nuts for some time. I have the same use case as the topic starter: gzip a docker tar output.