Skip to content

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

:bug: Fix relative path when importing markdown folder (#14096)

Levi Zim530345bd09b7
diff --git a/kernel/model/import.go b/kernel/model/import.go
index 87dd85ddb5..6691e92135 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -866,13 +866,13 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
return ast.WalkContinue
}
- absolutePath := filepath.Join(localPath, dest)
+ absolutePath := filepath.Join(currentDir, dest)
newAbsolutePath := absolutePath
decodedDest := string(html.DecodeDestination([]byte(dest)))
if decodedDest != dest {
dest = decodedDest
- newAbsolutePath = filepath.Join(localPath, dest)
+ newAbsolutePath = filepath.Join(currentDir, dest)
gulu.File.Copy(absolutePath, newAbsolutePath)
}