Skip to content

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

:bug: Initialization interface hangs on the macOS Fix https://github.com/siyuan-note/siyuan/issues/7887

Liang Dingc836dc72ce29
diff --git a/app/electron/init.html b/app/electron/init.html
index 35ed4fb94c..70a07683bf 100644
--- a/app/electron/init.html
+++ b/app/electron/init.html
@@ -416,9 +416,21 @@
}
const walk = (dir, files = []) => {
+ var dirFiles;
const fs = require('fs')
+ try {
+ if (!fs.existsSync(dir)) {
+ console.log("dir [" + dir + "] not exists")
+ return files
+ }
+
+ dirFiles = fs.readdirSync(dir)
+ } catch (e) {
+ console.error("read dir [" + dir + "] failed: ", e)
+ return files
+ }
+
const path = require('path')
- const dirFiles = fs.readdirSync(dir)
for (const f of dirFiles) {
let stat = fs.lstatSync(dir + path.sep + f)
if (stat.isSymbolicLink()) {