Skip to content

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

:fire: 删除冗余代码

Liang Ding51066a187bb6
diff --git a/kernel/model/import.go b/kernel/model/import.go
index 61f3919bb0..a5cfef20d8 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -350,7 +350,6 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
writingDataLock.Lock()
defer writingDataLock.Unlock()
- box := Conf.Box(boxID)
var baseHPath, baseTargetPath, boxLocalPath string
if "/" == toPath {
baseHPath = "/"
@@ -367,12 +366,6 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
boxLocalPath = filepath.Join(util.DataDir, boxID)
if gulu.File.IsDir(localPath) {
- folderName := filepath.Base(localPath)
- p := path.Join(toPath, folderName)
- if box.Exist(p) {
- return errors.New(Conf.Language(1))
- }
-
// 收集所有资源文件
assets := map[string]string{}
filepath.Walk(localPath, func(currentPath string, info os.FileInfo, walkErr error) error {