Skip to content

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

:art: Ignore hidden files when cleaning unused assets https://github.com/siyuan-note/siyuan/issues/12172

Daniela070db1933e6
diff --git a/kernel/model/assets.go b/kernel/model/assets.go
index 4ac8e8eaa1..06a9567e20 100644
--- a/kernel/model/assets.go
+++ b/kernel/model/assets.go
@@ -1207,6 +1207,11 @@ func allAssetAbsPaths() (assetsAbsPathMap map[string]string, err error) {
return nil
}
+ if filelock.IsHidden(path) {
+ // 清理资源文件时忽略隐藏文件 Ignore hidden files when cleaning unused assets https://github.com/siyuan-note/siyuan/issues/12172
+ return nil
+ }
+
if info.IsDir() && "assets" == info.Name() {
filelock.Walk(path, func(assetPath string, info fs.FileInfo, err error) error {
if path == assetPath {
@@ -1245,6 +1250,12 @@ func allAssetAbsPaths() (assetsAbsPathMap map[string]string, err error) {
}
return nil
}
+
+ if filelock.IsHidden(assetPath) {
+ // 清理资源文件时忽略隐藏文件 Ignore hidden files when cleaning unused assets https://github.com/siyuan-note/siyuan/issues/12172
+ return nil
+ }
+
relPath := filepath.ToSlash(assetPath)
relPath = relPath[strings.Index(relPath, "assets/"):]
if info.IsDir() {