mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Improve boot
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
4ee7497afd
commit
d34cd984d8
2 changed files with 8 additions and 3 deletions
|
|
@ -339,8 +339,6 @@ func ReadWorkspacePaths() (ret []string, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
logging.LogInfof("read data [%s] from workspace conf [%s]", string(data), workspaceConf)
|
|
||||||
|
|
||||||
if err = gulu.JSON.UnmarshalJSON(data, &ret); err != nil {
|
if err = gulu.JSON.UnmarshalJSON(data, &ret); err != nil {
|
||||||
msg := fmt.Sprintf("unmarshal workspace conf [%s] failed: %s", workspaceConf, err)
|
msg := fmt.Sprintf("unmarshal workspace conf [%s] failed: %s", workspaceConf, err)
|
||||||
logging.LogErrorf(msg)
|
logging.LogErrorf(msg)
|
||||||
|
|
@ -349,10 +347,18 @@ func ReadWorkspacePaths() (ret []string, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var tmp []string
|
var tmp []string
|
||||||
|
workspaceBaseDir := filepath.Dir(HomeDir)
|
||||||
for _, d := range ret {
|
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
|
d = strings.TrimRight(d, " \t\n") // 去掉工作空间路径尾部空格 https://github.com/siyuan-note/siyuan/issues/6353
|
||||||
if gulu.File.IsDir(d) {
|
if gulu.File.IsDir(d) {
|
||||||
tmp = append(tmp, d)
|
tmp = append(tmp, d)
|
||||||
|
} else {
|
||||||
|
logging.LogWarnf("workspace path [%s] is not a dir", d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = tmp
|
ret = tmp
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,6 @@ func initWorkspaceDirMobile(workspaceBaseDir string) {
|
||||||
workspacePaths = append(workspacePaths, WorkspaceDir)
|
workspacePaths = append(workspacePaths, WorkspaceDir)
|
||||||
} else {
|
} else {
|
||||||
workspacePaths, _ = ReadWorkspacePaths()
|
workspacePaths, _ = ReadWorkspacePaths()
|
||||||
logging.LogInfof("1 read workspace paths [%s]", strings.Join(workspacePaths, ","))
|
|
||||||
|
|
||||||
if 0 < len(workspacePaths) {
|
if 0 < len(workspacePaths) {
|
||||||
WorkspaceDir = workspacePaths[len(workspacePaths)-1]
|
WorkspaceDir = workspacePaths[len(workspacePaths)-1]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue