mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
🎨 Update av export
This commit is contained in:
parent
d87191b3a6
commit
d08edc086f
1 changed files with 6 additions and 4 deletions
|
|
@ -199,7 +199,8 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
}
|
||||
|
||||
// 将关联的数据库文件移动到 data/storage/av/ 下
|
||||
storageAvDir := filepath.Join(unzipRootPath, "storage", "av")
|
||||
storage := filepath.Join(unzipRootPath, "storage")
|
||||
storageAvDir := filepath.Join(storage, "av")
|
||||
if gulu.File.IsExist(storageAvDir) {
|
||||
// 将数据库文件中的块 ID 替换为新的块 ID
|
||||
filepath.Walk(storageAvDir, func(path string, info fs.FileInfo, err error) error {
|
||||
|
|
@ -230,10 +231,11 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
|
|||
if copyErr := filelock.Copy(storageAvDir, targetStorageAvDir); nil != copyErr {
|
||||
logging.LogErrorf("copy storage av dir from [%s] to [%s] failed: %s", storageAvDir, targetStorageAvDir, copyErr)
|
||||
}
|
||||
}
|
||||
|
||||
if removeErr := os.RemoveAll(storageAvDir); nil != removeErr {
|
||||
logging.LogErrorf("remove temp storage av dir failed: %s", removeErr)
|
||||
}
|
||||
// storage 文件夹已在上方处理,所以这里删除源 storage 文件夹,避免后面拷贝到导入目录下
|
||||
if removeErr := os.RemoveAll(storage); nil != removeErr {
|
||||
logging.LogErrorf("remove temp storage av dir failed: %s", removeErr)
|
||||
}
|
||||
|
||||
// 写回 .sy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue