Fixed compression error (#1097)

This commit is contained in:
link 2023-05-19 16:50:48 +08:00 committed by GitHub
parent 280ad4fcf9
commit 2fefee87fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,