Skip to content

Commit

Permalink
Merge pull request #33 from itchyny/deflate-zip
Browse files Browse the repository at this point in the history
Use deflate algorithm for zip archives
  • Loading branch information
Songmu authored May 6, 2022
2 parents 775ceb0 + 7f428a8 commit 184db79
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,17 @@ func (bdr *builder) build() (string, error) {
}
}

var arch archiver.Archiver = &archiver.Zip{
CompressionLevel: flate.DefaultCompression,
MkdirAll: true,
SelectiveCompression: true,
}
archiveFilePath := workDir + ".zip"
if !bdr.zipAlways && bdr.platform.os != "windows" && bdr.platform.os != "darwin" {
var arch archiver.Archiver
var archiveFilePath string
if bdr.zipAlways || bdr.platform.os == "windows" || bdr.platform.os == "darwin" {
arch = &archiver.Zip{
CompressionLevel: flate.DefaultCompression,
MkdirAll: true,
SelectiveCompression: true,
FileMethod: archiver.Deflate,
}
archiveFilePath = workDir + ".zip"
} else {
arch = &archiver.TarGz{
CompressionLevel: gzip.DefaultCompression,
Tar: &archiver.Tar{
Expand Down

0 comments on commit 184db79

Please sign in to comment.