🎨 Improve remove workspace dir path https://ld246.com/article/1703151906396

This commit is contained in:
Daniel 2023-12-22 23:37:54 +08:00
parent d9b5110ea5
commit 2742fc369b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -138,8 +138,11 @@ func removeWorkspaceDir(c *gin.Context) {
path := arg["path"].(string)
if util.IsWorkspaceLocked(path) {
logging.LogWarnf("skip remove workspace [%s] because it is locked", path)
if util.IsWorkspaceLocked(path) || util.WorkspaceDir == path {
msg := "Cannot remove current workspace"
ret.Code = -1
ret.Msg = msg
ret.Data = map[string]interface{}{"closeTimeout": 3000}
return
}