mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-15 02:04:46 +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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
hdr.Method = zip.Deflate
|
||||||
hdr.Name = file.NameInArchive
|
hdr.Name = file.NameInArchive
|
||||||
if file.IsDir() {
|
if file.IsDir() {
|
||||||
if !strings.HasSuffix(hdr.Name, "/") {
|
if !strings.HasSuffix(hdr.Name, "/") {
|
||||||
hdr.Name += "/"
|
hdr.Name += "/"
|
||||||
}
|
}
|
||||||
hdr.Method = zip.Store
|
|
||||||
}
|
}
|
||||||
w, err := zw.CreateHeader(hdr)
|
w, err := zw.CreateHeader(hdr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user