Skip to content

Commit

Permalink
Merge pull request #57 from screwdriver-cd/revert-56-incrcompressions…
Browse files Browse the repository at this point in the history
…peed

fix(1906): revert - increase compression speed using flate
  • Loading branch information
vnugopal authored Jan 17, 2020
2 parents db97f79 + 9bba6c4 commit 599f32b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions sdstore/ziphelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package sdstore

import (
"archive/zip"
"compress/flate"
"fmt"
"io"
"log"
Expand Down Expand Up @@ -44,19 +43,15 @@ var compressedFormats = map[string]struct{}{
// Zip is repurposed from https://github.com/mholt/archiver/pull/92/files
// To include support for symbolic links
func Zip(source, target string) error {
zipFile, err := os.Create(target)
zipfile, err := os.Create(target)
if err != nil {
return err
}
defer zipFile.Close()
defer zipfile.Close()

w := zip.NewWriter(zipFile)
w := zip.NewWriter(zipfile)
defer w.Close()

w.RegisterCompressor(zip.Deflate, func(out io.Writer) (io.WriteCloser, error) {
return flate.NewWriter(out, flate.BestSpeed)
})

sourceInfo, err := os.Stat(source)
if err != nil {
return fmt.Errorf("%s: stat: %v", source, err)
Expand Down

0 comments on commit 599f32b

Please sign in to comment.