mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-14 01:34:47 +08:00
fix: 解决 zip 压缩前后大小不变的问题 (#3610)
This commit is contained in:
parent
817fd123da
commit
6f0f282b7e
@ -606,12 +606,12 @@ func ZipFile(files []archiver.File, dst afero.File) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hdr.Method = zip.Deflate
|
||||
hdr.Name = file.NameInArchive
|
||||
if file.IsDir() {
|
||||
if !strings.HasSuffix(hdr.Name, "/") {
|
||||
hdr.Name += "/"
|
||||
}
|
||||
hdr.Method = zip.Store
|
||||
}
|
||||
w, err := zw.CreateHeader(hdr)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user