mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve workspace dir checking https://github.com/siyuan-note/siyuan/issues/13789
This commit is contained in:
parent
e01b7256b5
commit
010139be3f
2 changed files with 21 additions and 1 deletions
|
|
@ -300,7 +300,7 @@ func setWorkspaceDir(c *gin.Context) {
|
|||
// 检查路径是否在已有的工作空间路径中
|
||||
pathIsWorkspace := util.IsWorkspaceDir(path)
|
||||
if !pathIsWorkspace {
|
||||
for p := filepath.Dir(path); "" != p; p = filepath.Dir(p) {
|
||||
for p := filepath.Dir(path); !util.IsRootPath(p); p = filepath.Dir(p) {
|
||||
if util.IsWorkspaceDir(p) {
|
||||
ret.Code = -1
|
||||
ret.Msg = fmt.Sprintf(model.Conf.Language(256), path, p)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue