Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve electron-related conf dir https://github.com/siyuan-note/siyuan/issues/13150

Daniel2acdad6ee482
diff --git a/app/electron/main.js b/app/electron/main.js
index ac42e8632d..c52a36234a 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -48,6 +48,9 @@ let resetWindowStateOnRestart = false;
remote.initialize();
+app.setPath("userData", app.getPath("userData") + "-Electron"); // `~/.config` 下 Electron 相关文件夹名称改为 `SiYuan-Electron` https://github.com/siyuan-note/siyuan/issues/3349
+fs.rmdirSync(app.getPath("appData") + "/" + app.name, {recursive: true}); // 删除自动创建的应用目录 https://github.com/siyuan-note/siyuan/issues/13150
+
if (!app.requestSingleInstanceLock()) {
app.quit();
return;
@@ -621,7 +624,6 @@ const initKernel = (workspace, port, lang) => {
};
app.setAsDefaultProtocolClient("siyuan");
-app.setPath("userData", app.getPath("userData") + "-Electron"); // `~/.config` 下 Electron 相关文件夹名称改为 `SiYuan-Electron` https://github.com/siyuan-note/siyuan/issues/3349
app.commandLine.appendSwitch("disable-web-security");
app.commandLine.appendSwitch("auto-detect", "false");