🎨 改进 Windows 端默认工作空间路径 Fix https://github.com/siyuan-note/siyuan/issues/5622

This commit is contained in:
Liang Ding 2022-08-12 11:41:03 +08:00
parent 3cd594c94c
commit 0a9987726a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -194,6 +194,13 @@ func initWorkspaceDir(workspaceArg string) {
}
defaultWorkspaceDir := filepath.Join(HomeDir, "Documents", "SiYuan")
if gulu.OS.IsWindows() {
// 改进 Windows 端默认工作空间路径 https://github.com/siyuan-note/siyuan/issues/5622
if userProfile := os.Getenv("USERPROFILE"); "" != userProfile {
defaultWorkspaceDir = filepath.Join(userProfile, "Documents", "SiYuan")
}
}
var workspacePaths []string
if !gulu.File.IsExist(workspaceConf) {
WorkspaceDir = defaultWorkspaceDir