1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 修复压缩包解压时可能的由于父目录不存在导致的解压失败的问题 (#2099)

Co-authored-by: allyxmiko-server <allyxmiko@gmail.com>
This commit is contained in:
Allyx 2023-08-28 22:37:48 +08:00 committed by wanghe-fit2cloud
parent 512c7daeee
commit 17062da52e

View File

@ -518,6 +518,13 @@ func (f FileOp) Decompress(srcFile string, dst string, cType CompressType) error
return err
}
return nil
} else {
parentDir := path.Dir(filePath)
if !f.Stat(parentDir) {
if err := f.Fs.MkdirAll(parentDir, info.Mode()); err != nil {
return err
}
}
}
fr, err := archFile.Open()
if err != nil {