Skip to content

Commit a106abc

Browse files
committed
Fixed compression error
1 parent 538639b commit a106abc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/utils/file/file.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,9 @@ func AddFile(ar archiver.Writer, path, commonPath string) error {
431431
defer file.Close()
432432

433433
if path != commonPath {
434-
filename := info.Name()
434+
//filename := info.Name()
435+
filename := strings.TrimPrefix(path, commonPath)
436+
filename = strings.TrimPrefix(filename, string(filepath.Separator))
435437
err = ar.Write(archiver.File{
436438
FileInfo: archiver.FileInfo{
437439
FileInfo: info,

0 commit comments

Comments
 (0)