Merge pull request #49 from steveb/asm-compress

Add --compress flag to tar-split asm
This commit is contained in:
Vincent Batts 2018-10-22 15:49:18 +01:00 committed by GitHub
commit 620714a4c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -37,6 +37,12 @@ func CommandAsm(c *cli.Context) {
outputStream = fh
}
if c.Bool("compress") {
zipper := gzip.NewWriter(outputStream)
defer zipper.Close()
outputStream = zipper
}
// Get the tar metadata reader
mf, err := os.Open(c.String("input"))
if err != nil {

View File

@ -69,6 +69,11 @@ func main() {
Value: "",
Usage: "relative path of extracted tar",
},
cli.BoolFlag{
Name: "compress",
Usage: "gzip compress the output",
// defaults to false
},
},
},
{