Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
8d02bfaeea
1 changed files with 6 additions and 5 deletions
|
@ -45,17 +45,18 @@ func createWorkspaceDir(c *gin.Context) {
|
|||
absPath := arg["path"].(string)
|
||||
absPath = gulu.Str.RemoveInvisible(absPath)
|
||||
absPath = strings.TrimSpace(absPath)
|
||||
if gulu.File.IsExist(absPath) {
|
||||
ret.Code = -1
|
||||
ret.Msg = model.Conf.Language(78)
|
||||
return
|
||||
}
|
||||
if isInvalidWorkspacePath(absPath) {
|
||||
ret.Code = -1
|
||||
ret.Msg = "This workspace name is not allowed, please use another name"
|
||||
return
|
||||
}
|
||||
|
||||
if gulu.File.IsExist(absPath) {
|
||||
ret.Code = -1
|
||||
ret.Msg = model.Conf.Language(78)
|
||||
return
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(absPath, 0755); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = fmt.Sprintf("create workspace dir [%s] failed: %s", absPath, err)
|
||||
|
|
Loading…
Add table
Reference in a new issue