From d34cd984d8850370aec26480afe84da713e390ba Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 9 Dec 2025 20:40:54 +0800 Subject: [PATCH] :art: Improve boot Signed-off-by: Daniel <845765@qq.com> --- kernel/util/working.go | 10 ++++++++-- kernel/util/working_mobile.go | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/kernel/util/working.go b/kernel/util/working.go index 701350bdc..aa4d6e890 100644 --- a/kernel/util/working.go +++ b/kernel/util/working.go @@ -339,8 +339,6 @@ func ReadWorkspacePaths() (ret []string, err error) { return } - logging.LogInfof("read data [%s] from workspace conf [%s]", string(data), workspaceConf) - if err = gulu.JSON.UnmarshalJSON(data, &ret); err != nil { msg := fmt.Sprintf("unmarshal workspace conf [%s] failed: %s", workspaceConf, err) logging.LogErrorf(msg) @@ -349,10 +347,18 @@ func ReadWorkspacePaths() (ret []string, err error) { } var tmp []string + workspaceBaseDir := filepath.Dir(HomeDir) for _, d := range ret { + if ContainerIOS == Container && strings.Contains(d, "/Documents/") { + d = d[strings.Index(d, "/Documents/")+len("/Documents/"):] + d = filepath.Join(workspaceBaseDir, d) + } + d = strings.TrimRight(d, " \t\n") // 去掉工作空间路径尾部空格 https://github.com/siyuan-note/siyuan/issues/6353 if gulu.File.IsDir(d) { tmp = append(tmp, d) + } else { + logging.LogWarnf("workspace path [%s] is not a dir", d) } } ret = tmp diff --git a/kernel/util/working_mobile.go b/kernel/util/working_mobile.go index 2dda1c439..6580d738c 100644 --- a/kernel/util/working_mobile.go +++ b/kernel/util/working_mobile.go @@ -129,7 +129,6 @@ func initWorkspaceDirMobile(workspaceBaseDir string) { workspacePaths = append(workspacePaths, WorkspaceDir) } else { workspacePaths, _ = ReadWorkspacePaths() - logging.LogInfof("1 read workspace paths [%s]", strings.Join(workspacePaths, ",")) if 0 < len(workspacePaths) { WorkspaceDir = workspacePaths[len(workspacePaths)-1]