diff --git a/client/deploy.go b/client/deploy.go index c8fd6a8..f041c45 100644 --- a/client/deploy.go +++ b/client/deploy.go @@ -55,6 +55,9 @@ func download(dir string, urlpath string, accessToken string) (string, error) { return filepath.ToSlash(out.Name()), nil } +func UnzipTest(fname string) error { + return unzip(fname) +} func unzip(fname string) error { archive, err := zip.OpenReader(fname) if err != nil { @@ -75,10 +78,12 @@ func unzip(fname string) error { name = f.Name } + name = strings.ReplaceAll(name, `\`, "/") filePath := path.Join(verpath, name) - - if f.FileInfo().IsDir() { - os.MkdirAll(filePath, 0775) + if f.FileInfo().IsDir() || strings.HasSuffix(f.FileInfo().Name(), `\`) { + if err = os.MkdirAll(filePath, 0775); err != nil { + return err + } continue }