mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 去掉工作空间路径尾部空格 Fix https://github.com/siyuan-note/siyuan/issues/6353
This commit is contained in:
parent
92e4df2483
commit
aecce8ac40
2 changed files with 6 additions and 0 deletions
|
|
@ -38,6 +38,11 @@ func listWorkspaceDirs(c *gin.Context) {
|
|||
userHomeConfDir := filepath.Join(util.HomeDir, ".config", "siyuan")
|
||||
workspaceConf := filepath.Join(userHomeConfDir, "workspace.json")
|
||||
data, err := os.ReadFile(workspaceConf)
|
||||
if nil != err {
|
||||
logging.LogErrorf("read workspace conf [%s] failed: %s", workspaceConf, err)
|
||||
return
|
||||
}
|
||||
|
||||
var workspacePaths []string
|
||||
if err = gulu.JSON.UnmarshalJSON(data, &workspacePaths); nil != err {
|
||||
logging.LogErrorf("unmarshal workspace conf [%s] failed: %s", workspaceConf, err)
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ func initWorkspaceDir(workspaceArg string) {
|
|||
|
||||
tmp := workspacePaths[:0]
|
||||
for _, d := range workspacePaths {
|
||||
d = strings.TrimRight(d, " \t\n") // 去掉工作空间路径尾部空格 https://github.com/siyuan-note/siyuan/issues/6353
|
||||
if gulu.File.IsDir(d) {
|
||||
tmp = append(tmp, d)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue