Skip to content

Commit

Permalink
Add brotli compression
Browse files Browse the repository at this point in the history
  • Loading branch information
triole committed Aug 14, 2024
1 parent 74b8ed1 commit 551a540
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/argparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func parseArgs() {
}),
kong.Vars{
"curdir": curdir,
"compressionFormats": "gz,lz4,snappy,xz",
"compressionFormats": "brotli,gz,lz4,snappy,xz",
},
)
CLI.SubCommand = ctx.Command()
Expand Down
6 changes: 6 additions & 0 deletions src/fileaxe/compression.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ func (fa FileAxe) compressFile(sourceFile FileInfo, target, compressionFormat st
},
Archival: archiver.Tar{},
}
if compressionFormat == "brotli" {
format = archiver.CompressedArchive{
Compression: archiver.Brotli{},
Archival: archiver.Tar{},
}
}
if compressionFormat == "lz4" {
format = archiver.CompressedArchive{
Compression: archiver.Lz4{},
Expand Down

0 comments on commit 551a540

Please sign in to comment.