From 838b3a219462217e34fbc60fb748fa78b0e698ac Mon Sep 17 00:00:00 2001 From: mountain Date: Tue, 13 Jun 2023 23:48:51 +0900 Subject: [PATCH] =?UTF-8?q?unzip=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=20-=20=EB=B0=B1=EC=8A=AC=EB=9E=98=EC=8B=9C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/deploy.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 }