mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-11-08 08:05:07 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f994210117 |
@@ -43,7 +43,7 @@ func (t TarArchiver) Compress(ctx context.Context, sourcePaths []string, dstFile
|
||||
return err
|
||||
}
|
||||
baseDir := filepath.Dir(sourcePaths[0])
|
||||
args := []string{t.getOptionStr("compress"), dstFile, "-C", baseDir}
|
||||
args := []string{t.getOptionStr("compress"), dstFile, "-C", baseDir, "--"}
|
||||
for _, sourcePath := range sourcePaths {
|
||||
args = append(args, filepath.Base(sourcePath))
|
||||
}
|
||||
|
||||
@@ -55,9 +55,9 @@ func (t TarGzArchiver) Compress(ctx context.Context, sourcePaths []string, dstFi
|
||||
aheadDir = "/"
|
||||
}
|
||||
if len(secret) != 0 {
|
||||
err = runTarGzEncryptToFile(cmd.NewCommandMgr(cmd.WithContext(ctx)), tmpFile, secret, append([]string{"-C", aheadDir}, itemDirs...)...)
|
||||
err = runTarGzEncryptToFile(cmd.NewCommandMgr(cmd.WithContext(ctx)), tmpFile, secret, append([]string{"-C", aheadDir, "--"}, itemDirs...)...)
|
||||
} else {
|
||||
err = runTarGzToFile(cmd.NewCommandMgr(cmd.WithContext(ctx)), tmpFile, append([]string{"-C", aheadDir}, itemDirs...)...)
|
||||
err = runTarGzToFile(cmd.NewCommandMgr(cmd.WithContext(ctx)), tmpFile, append([]string{"-C", aheadDir, "--"}, itemDirs...)...)
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user