From 049090444ec06df3461f7660b6e1b37a65d82b57 Mon Sep 17 00:00:00 2001 From: link Date: Thu, 25 Nov 2021 19:41:25 +0800 Subject: [PATCH] fixed path error --- route/v1/docker.go | 5 +++-- service/app.go | 7 +++---- types/system.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/route/v1/docker.go b/route/v1/docker.go index 86d5037e2..3b15efe3a 100644 --- a/route/v1/docker.go +++ b/route/v1/docker.go @@ -690,8 +690,9 @@ func UnInstallApp(c *gin.Context) { //step: 删除文件夹 vol := gjson.Get(info.Volumes, "#.host") for _, v := range vol.Array() { - - service.MyService.App().DelAppConfigDir(appId, v.String()) + if strings.Contains(v.String(), appId) { + service.MyService.App().DelAppConfigDir(v.String()) + } } //step: 删除install log diff --git a/service/app.go b/service/app.go index 8130ac71b..c7f065958 100644 --- a/service/app.go +++ b/service/app.go @@ -6,7 +6,6 @@ import ( "time" "github.com/IceWhaleTech/CasaOS/pkg/config" - "github.com/IceWhaleTech/CasaOS/pkg/docker" "github.com/IceWhaleTech/CasaOS/pkg/utils/command" loger2 "github.com/IceWhaleTech/CasaOS/pkg/utils/loger" model2 "github.com/IceWhaleTech/CasaOS/service/model" @@ -26,7 +25,7 @@ type AppService interface { GetAppDBInfo(id string) model2.AppListDBModel UpdateApp(m model2.AppListDBModel) GetSimpleContainerInfo(name string) (types.Container, error) - DelAppConfigDir(id, path string) + DelAppConfigDir(path string) GetSystemAppList() *[]model2.MyAppList } @@ -224,8 +223,8 @@ func (a *appStruct) UpdateApp(m model2.AppListDBModel) { a.db.Table(model2.CONTAINERTABLENAME).Save(&m) } -func (a *appStruct) DelAppConfigDir(id, path string) { - command.OnlyExec("source " + config.AppInfo.ProjectPath + "/shell/helper.sh ;DelAppConfigDir " + docker.GetDir(id, path)) +func (a *appStruct) DelAppConfigDir(path string) { + command.OnlyExec("source " + config.AppInfo.ProjectPath + "/shell/helper.sh ;DelAppConfigDir " + path) } func (a *appStruct) RemoveContainerById(id string) { diff --git a/types/system.go b/types/system.go index 9b68dcbb8..5a73686c8 100644 --- a/types/system.go +++ b/types/system.go @@ -1,4 +1,4 @@ package types -const CURRENTVERSION = "0.2.0" -const BODY = "
  • add sync function
  • fixed some error
  • " +const CURRENTVERSION = "0.2.1" +const BODY = "
  • fixed path error
  • "