Upgraded archiver dependency to v3.5.1 (#2378)

This commit is contained in:
Ankit Chawla
2022-03-14 10:29:28 +05:30
committed by GitHub
parent 21c76683ef
commit 2f8fde0af0
6 changed files with 49 additions and 23 deletions
+11 -2
View File
@@ -28,7 +28,7 @@ import (
"path/filepath"
"strings"
"github.com/mholt/archiver"
"github.com/mholt/archiver/v3"
"github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
"golang.org/x/net/context/ctxhttp"
@@ -94,7 +94,7 @@ func MakeZipArchive(targetName string, globs ...string) (string, error) {
}
// zip up the file list
err = archiver.Zip.Make(targetName, files)
err = archiver.DefaultZip.Archive(files, targetName)
if err != nil {
return "", err
}
@@ -205,3 +205,12 @@ func DownloadUrl(ctx context.Context, httpClient *http.Client, url string, local
return nil
}
func IsZip(filename string) (bool, error) {
f, err := os.Open(filename)
if err != nil {
return false, nil
}
defer f.Close()
return archiver.DefaultZip.Match(f)
}