mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-16 18:54:43 +08:00
fix: 解决应用备份或升级失败的问题 (#1306)
This commit is contained in:
parent
8f036a0c3d
commit
7c600a357c
@ -99,7 +99,7 @@ func handleAppBackup(install *model.AppInstall, backupDir, fileName string) erro
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
appPath := fmt.Sprintf("%s/%s", install.GetPath(), install.Name)
|
appPath := install.GetPath()
|
||||||
if err := handleTar(appPath, tmpDir, "app.tar.gz", ""); err != nil {
|
if err := handleTar(appPath, tmpDir, "app.tar.gz", ""); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ func handleTar(sourceDir, targetDir, name, exclusionRules string) error {
|
|||||||
path := ""
|
path := ""
|
||||||
if strings.Contains(sourceDir, "/") {
|
if strings.Contains(sourceDir, "/") {
|
||||||
itemDir := strings.ReplaceAll(sourceDir[strings.LastIndex(sourceDir, "/"):], "/", "")
|
itemDir := strings.ReplaceAll(sourceDir[strings.LastIndex(sourceDir, "/"):], "/", "")
|
||||||
aheadDir := strings.ReplaceAll(sourceDir, itemDir, "")
|
aheadDir := sourceDir[:strings.LastIndex(sourceDir, "/")]
|
||||||
path += fmt.Sprintf("-C %s %s", aheadDir, itemDir)
|
path += fmt.Sprintf("-C %s %s", aheadDir, itemDir)
|
||||||
} else {
|
} else {
|
||||||
path = sourceDir
|
path = sourceDir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user