Skip to content

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

:art: 资源文件夹不存在时自动创建

Liang Ding7959a6a99402
diff --git a/kernel/model/assets_watcher.go b/kernel/model/assets_watcher.go
index 5413e3517d..a5926b8ab9 100644
--- a/kernel/model/assets_watcher.go
+++ b/kernel/model/assets_watcher.go
@@ -19,9 +19,11 @@
package model
import (
+ "os"
"path/filepath"
"time"
+ "github.com/88250/gulu"
"github.com/fsnotify/fsnotify"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/cache"
@@ -89,6 +91,10 @@ func watchAssets() {
}
}()
+ if !gulu.File.IsDir(assetsDir) {
+ os.MkdirAll(assetsDir, 0755)
+ }
+
if err = assetsWatcher.Add(assetsDir); err != nil {
logging.LogErrorf("add assets watcher for folder [%s] failed: %s", assetsDir, err)
}