From bcc9886518a4b8e221d916f2d103e1a490dfa300 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Tue, 24 Feb 2026 17:59:20 +0800 Subject: [PATCH] :art: Change the initial workspace path to ~/Library/Application Support/SiYuan on macOS https://github.com/siyuan-note/siyuan/issues/17095 Signed-off-by: Daniel <845765@qq.com> --- app/electron/init.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/electron/init.html b/app/electron/init.html index 43b1b1634..4bea0c317 100644 --- a/app/electron/init.html +++ b/app/electron/init.html @@ -437,7 +437,11 @@ const path = require('path') const fs = require('fs') - const defaultWorkspace = path.join(decodeURIComponent(getSearch('home')), "SiYuan") + let defaultWorkspace = path.join(decodeURIComponent(getSearch('home')), "SiYuan") + if ("darwin" === process.platform) { + // Change the initial workspace path to ~/Library/Application Support/SiYuan on macOS https://github.com/siyuan-note/siyuan/issues/17095 + defaultWorkspace = path.join(decodeURIComponent(getSearch('home')), "Application Support", "SiYuan") + } if (!fs.existsSync(defaultWorkspace)) { fs.mkdirSync(defaultWorkspace, {mode: 0o755, recursive: true}) }