Compare commits

..

1 Commits

Author SHA1 Message Date
LinkLeong
a106abc8ba Fixed compression error 2023-05-15 11:40:52 +01:00

View File

@@ -431,7 +431,9 @@ func AddFile(ar archiver.Writer, path, commonPath string) error {
defer file.Close() defer file.Close()
if path != commonPath { 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{ err = ar.Write(archiver.File{
FileInfo: archiver.FileInfo{ FileInfo: archiver.FileInfo{
FileInfo: info, FileInfo: info,