Selaa lähdekoodia

Merge pull request #27 from IceWhaleTech/v0.2.1

fixed path error
link 3 vuotta sitten
vanhempi
commit
cc46a96a75
3 muutettua tiedostoa jossa 8 lisäystä ja 8 poistoa
  1. 3 2
      route/v1/docker.go
  2. 3 4
      service/app.go
  3. 2 2
      types/system.go

+ 3 - 2
route/v1/docker.go

@@ -690,8 +690,9 @@ func UnInstallApp(c *gin.Context) {
 		//step: 删除文件夹
 		//step: 删除文件夹
 		vol := gjson.Get(info.Volumes, "#.host")
 		vol := gjson.Get(info.Volumes, "#.host")
 		for _, v := range vol.Array() {
 		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
 		//step: 删除install log

+ 3 - 4
service/app.go

@@ -6,7 +6,6 @@ import (
 	"time"
 	"time"
 
 
 	"github.com/IceWhaleTech/CasaOS/pkg/config"
 	"github.com/IceWhaleTech/CasaOS/pkg/config"
-	"github.com/IceWhaleTech/CasaOS/pkg/docker"
 	"github.com/IceWhaleTech/CasaOS/pkg/utils/command"
 	"github.com/IceWhaleTech/CasaOS/pkg/utils/command"
 	loger2 "github.com/IceWhaleTech/CasaOS/pkg/utils/loger"
 	loger2 "github.com/IceWhaleTech/CasaOS/pkg/utils/loger"
 	model2 "github.com/IceWhaleTech/CasaOS/service/model"
 	model2 "github.com/IceWhaleTech/CasaOS/service/model"
@@ -26,7 +25,7 @@ type AppService interface {
 	GetAppDBInfo(id string) model2.AppListDBModel
 	GetAppDBInfo(id string) model2.AppListDBModel
 	UpdateApp(m model2.AppListDBModel)
 	UpdateApp(m model2.AppListDBModel)
 	GetSimpleContainerInfo(name string) (types.Container, error)
 	GetSimpleContainerInfo(name string) (types.Container, error)
-	DelAppConfigDir(id, path string)
+	DelAppConfigDir(path string)
 	GetSystemAppList() *[]model2.MyAppList
 	GetSystemAppList() *[]model2.MyAppList
 }
 }
 
 
@@ -224,8 +223,8 @@ func (a *appStruct) UpdateApp(m model2.AppListDBModel) {
 	a.db.Table(model2.CONTAINERTABLENAME).Save(&m)
 	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) {
 func (a *appStruct) RemoveContainerById(id string) {

+ 2 - 2
types/system.go

@@ -1,4 +1,4 @@
 package types
 package types
 
 
-const CURRENTVERSION = "0.2.0"
-const BODY = "<li>add sync function</li><li>fixed some error</li>"
+const CURRENTVERSION = "0.2.1"
+const BODY = "<li>fixed path error</li>"