1
1
mirror of https://github.com/walles/moar.git synced 2024-10-05 16:07:54 +03:00

Decompress .tgz files befire "showing" them

These files are archives, which moar is not designed to view. However,
for tar files containing text, decompressing them before showing them
will make at least text files in the archive readable.

Fixes #194.
This commit is contained in:
Johan Walles 2024-02-16 12:44:07 +01:00
parent 59270d6f8c
commit 7fd69ad308

View File

@ -21,6 +21,10 @@ func ZOpen(filename string) (io.ReadCloser, error) {
case strings.HasSuffix(filename, ".gz"):
return gzip.NewReader(file)
// Ref: https://github.com/walles/moar/issues/194
case strings.HasSuffix(filename, ".tgz"):
return gzip.NewReader(file)
case strings.HasSuffix(filename, ".bz2"):
return struct {
io.Reader