From 2fefee87facf6597fcac270215beba2b32309bd9 Mon Sep 17 00:00:00 2001 From: link Date: Fri, 19 May 2023 16:50:48 +0800 Subject: [PATCH] Fixed compression error (#1097) --- pkg/utils/file/file.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/utils/file/file.go b/pkg/utils/file/file.go index 7a1e83c..e67a8e4 100644 --- a/pkg/utils/file/file.go +++ b/pkg/utils/file/file.go @@ -431,7 +431,9 @@ func AddFile(ar archiver.Writer, path, commonPath string) error { defer file.Close() if path != commonPath { - filename := info.Name() + //filename := info.Name() + filename := strings.TrimPrefix(path, commonPath) + filename = strings.TrimPrefix(filename, string(filepath.Separator)) err = ar.Write(archiver.File{ FileInfo: archiver.FileInfo{ FileInfo: info,