2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 07:57:21 +08:00

fix: test

This commit is contained in:
耗子
2024-10-28 01:28:28 +08:00
parent 036e01795e
commit 8d6b3fe95e

View File

@@ -27,7 +27,10 @@ func Compress(dir string, src []string, dst string) error {
}
// 去掉路径前缀,减少压缩包内文件夹层级
for i, s := range src {
src[i] = strings.TrimPrefix(s, dir)
if strings.HasPrefix(s, dir) {
s = strings.TrimPrefix(s, dir)
src[i] = strings.TrimPrefix(s, "/")
}
if src[i] == "" {
src[i] = "."
}