mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 11:42:26 +08:00
feat(edit-docs): clean up ZIP file
This commit is contained in:
parent
df2a9aed44
commit
bffb0963df
@ -17,6 +17,9 @@ async function exportData() {
|
|||||||
const zipFilePath = "output.zip";
|
const zipFilePath = "output.zip";
|
||||||
const destRootPath = path.join("src", "public", "app", "doc_notes", "en", "User Guide");
|
const destRootPath = path.join("src", "public", "app", "doc_notes", "en", "User Guide");
|
||||||
|
|
||||||
|
const deferred = (await import("./src/services/utils.js")).deferred;
|
||||||
|
|
||||||
|
try {
|
||||||
await fsExtra.remove(destRootPath);
|
await fsExtra.remove(destRootPath);
|
||||||
await fsExtra.mkdir(destRootPath);
|
await fsExtra.mkdir(destRootPath);
|
||||||
|
|
||||||
@ -24,6 +27,7 @@ async function exportData() {
|
|||||||
const { exportToZipFile } = (await import("./src/services/export/zip.js")).default;
|
const { exportToZipFile } = (await import("./src/services/export/zip.js")).default;
|
||||||
await exportToZipFile(NOTE_ID_USER_GUIDE, "html", zipFilePath);
|
await exportToZipFile(NOTE_ID_USER_GUIDE, "html", zipFilePath);
|
||||||
|
|
||||||
|
const promise = deferred<void>()
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
// Then extract the zip.
|
// Then extract the zip.
|
||||||
const { readZipFile, readContent } = (await import("./src/services/import/zip.js"));
|
const { readZipFile, readContent } = (await import("./src/services/import/zip.js"));
|
||||||
@ -39,7 +43,14 @@ async function exportData() {
|
|||||||
|
|
||||||
zip.readEntry();
|
zip.readEntry();
|
||||||
});
|
});
|
||||||
|
promise.resolve();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
await promise;
|
||||||
|
} finally {
|
||||||
|
if (await fsExtra.exists(zipFilePath)) {
|
||||||
|
await fsExtra.rm(zipFilePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await main();
|
await main();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user