Skip to content

Commit

Permalink
Merge pull request #4 from BlueSkyDetector/PR/update-for-archiver-2.0…
Browse files Browse the repository at this point in the history
…-api

Fix extraction code failure by updating it for archiver 2.0 API
  • Loading branch information
Songmu authored Dec 15, 2016
2 parents d648d79 + 1b15e36 commit 52cb139
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ghg.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ func progbar(r io.Reader, size int64) io.Reader {
func extract(src, dest string) error {
base := filepath.Base(src)
if strings.HasSuffix(base, ".zip") {
return archiver.Unzip(src, dest)
return archiver.Zip.Open(src, dest)
}
if strings.HasSuffix(base, ".tar.gz") || strings.HasSuffix(base, ".tgz") {
return archiver.UntarGz(src, dest)
return archiver.TarGz.Open(src, dest)
}
return fmt.Errorf("failed to extract file: %s", src)
}
Expand Down

0 comments on commit 52cb139

Please sign in to comment.