Skip to content

Commit

Permalink
fix: #6, #9
Browse files Browse the repository at this point in the history
  • Loading branch information
MuiseDestiny committed Jan 2, 2024
1 parent c1a5148 commit 4cc433f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/modules/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,18 @@ export async function moveFile(attItem: Zotero.Item) {
return;
}
// 1. 目标根路径
let destDir = getPref("destDir") as string;
// if (!(await OS.File.exists(destDir))) {
// window.alert("The destination path is not configured or does not exist.")
// return
// }
let destDir: string | boolean = getPref("destDir") as string;
if (!destDir) {
destDir = await new ztoolkit.FilePicker(
"Select Destination Directory",
"folder",
).open();
if (destDir) {
setPref("destDir", destDir);
} else {
return
}
}
// 2. 中间路径
// const folderSep = Zotero.isWin ? "\\" : "/";
let subfolder = "";
Expand Down Expand Up @@ -466,8 +473,8 @@ function getCollectionPathsOfItem(item: Zotero.Item) {
}
return OS.Path.normalize(
getCollectionPath(collection.parentID) +
addon.data.folderSep +
collection.name,
addon.data.folderSep +
collection.name,
) as string;
};
try {
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit 4cc433f

Please sign in to comment.