From 13f06322ddbb00a66000d76af7c41e528ce8273c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sat, 24 Jan 2026 01:31:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=8B=E7=BC=A9=E6=97=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=88=9B=E5=BB=BA=E7=9B=AE=E6=A0=87=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/io/compress.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/io/compress.go b/pkg/io/compress.go index 721161d9..b93b57dd 100644 --- a/pkg/io/compress.go +++ b/pkg/io/compress.go @@ -29,6 +29,10 @@ func Compress(dir string, src []string, dst string) error { src = append(src, ".") } + if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { + return err + } + format, err := formatArchiveByPath(dst) if err != nil { return err @@ -59,10 +63,8 @@ func UnCompress(src string, dst string) error { if !filepath.IsAbs(src) || !filepath.IsAbs(dst) { return errors.New("src and dst must be absolute path") } - if !Exists(dst) { - if err := os.MkdirAll(dst, 0755); err != nil { - return err - } + if err := os.MkdirAll(dst, 0755); err != nil { + return err } format, err := formatArchiveByPath(src)