mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 06:31:06 +08:00
🎨 启动时移除处于网盘路径下的工作空间 https://github.com/siyuan-note/siyuan/issues/7790
This commit is contained in:
parent
1e7cf8917b
commit
b7b8ae998f
@ -207,6 +207,7 @@ func initWorkspaceDir(workspaceArg string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var workspacePaths []string
|
var workspacePaths []string
|
||||||
|
var cloudDrive bool // 启动时移除处于网盘路径下的工作空间 https://github.com/siyuan-note/siyuan/issues/7790
|
||||||
if !gulu.File.IsExist(workspaceConf) {
|
if !gulu.File.IsExist(workspaceConf) {
|
||||||
WorkspaceDir = defaultWorkspaceDir
|
WorkspaceDir = defaultWorkspaceDir
|
||||||
if "" != workspaceArg {
|
if "" != workspaceArg {
|
||||||
@ -214,11 +215,11 @@ func initWorkspaceDir(workspaceArg string) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
workspacePaths, _ = ReadWorkspacePaths()
|
workspacePaths, _ = ReadWorkspacePaths()
|
||||||
// 启动时移除处于网盘路径下的工作空间 https://github.com/siyuan-note/siyuan/issues/7790
|
|
||||||
var tmp []string
|
var tmp []string
|
||||||
for _, workspacePath := range workspacePaths {
|
for _, workspacePath := range workspacePaths {
|
||||||
if IsCloudDrivePath(workspacePath) {
|
if IsCloudDrivePath(workspacePath) {
|
||||||
logging.LogWarnf("skip the cloud drive path [%s]", workspacePath)
|
logging.LogWarnf("skip the cloud drive path [%s]", workspacePath)
|
||||||
|
cloudDrive = true
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
tmp = append(tmp, workspacePath)
|
tmp = append(tmp, workspacePath)
|
||||||
@ -248,6 +249,10 @@ func initWorkspaceDir(workspaceArg string) {
|
|||||||
os.Exit(logging.ExitCodeInitWorkspaceErr)
|
os.Exit(logging.ExitCodeInitWorkspaceErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cloudDrive {
|
||||||
|
os.Exit(logging.ExitCodeFileSysErr)
|
||||||
|
}
|
||||||
|
|
||||||
ConfDir = filepath.Join(WorkspaceDir, "conf")
|
ConfDir = filepath.Join(WorkspaceDir, "conf")
|
||||||
DataDir = filepath.Join(WorkspaceDir, "data")
|
DataDir = filepath.Join(WorkspaceDir, "data")
|
||||||
RepoDir = filepath.Join(WorkspaceDir, "repo")
|
RepoDir = filepath.Join(WorkspaceDir, "repo")
|
||||||
|
Loading…
Reference in New Issue
Block a user