Skip to content

Commit

Permalink
fixed path error
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong committed Nov 25, 2021
1 parent 9057290 commit 0490904
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions route/v1/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions service/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}

Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions types/system.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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>"

0 comments on commit 0490904

Please sign in to comment.