mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
fix: skip junction creation if Zotero data dir is inside vault
This commit is contained in:
parent
a4ede4303a
commit
b6e59043b2
1 changed files with 14 additions and 8 deletions
|
|
@ -677,17 +677,23 @@ class ZoteroStep(StepScreen):
|
|||
)
|
||||
return
|
||||
|
||||
# 安全检查:zotero_data 不能是 Vault 的子目录
|
||||
# 检查:Zotero 数据目录是否在 Vault 内部
|
||||
is_inside_vault = False
|
||||
try:
|
||||
zotero_data.relative_to(vault)
|
||||
self.set_status(
|
||||
"错误:Zotero 数据目录不能放在 Vault 内部。\n"
|
||||
"请使用 Zotero 默认的数据目录路径",
|
||||
False
|
||||
)
|
||||
return
|
||||
is_inside_vault = True
|
||||
except ValueError:
|
||||
pass # 不是子目录,正常
|
||||
pass
|
||||
|
||||
if is_inside_vault:
|
||||
# 在 Vault 内部,跳过创建 Junction,直接通过
|
||||
self.set_status(
|
||||
f"检测到 Zotero 数据目录在 Vault 内部,无需创建链接\n"
|
||||
f"路径: {zotero_data}",
|
||||
True
|
||||
)
|
||||
self.app.post_message(StepPassed(self.step_idx))
|
||||
return
|
||||
|
||||
# Remove existing
|
||||
if junction_path.exists() or junction_path.is_symlink():
|
||||
|
|
|
|||
Loading…
Reference in a new issue