mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +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 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.mkdir(destRootPath);
|
||||
|
||||
@ -24,6 +27,7 @@ async function exportData() {
|
||||
const { exportToZipFile } = (await import("./src/services/export/zip.js")).default;
|
||||
await exportToZipFile(NOTE_ID_USER_GUIDE, "html", zipFilePath);
|
||||
|
||||
const promise = deferred<void>()
|
||||
setTimeout(async () => {
|
||||
// Then extract the zip.
|
||||
const { readZipFile, readContent } = (await import("./src/services/import/zip.js"));
|
||||
@ -39,7 +43,14 @@ async function exportData() {
|
||||
|
||||
zip.readEntry();
|
||||
});
|
||||
promise.resolve();
|
||||
}, 1000);
|
||||
await promise;
|
||||
} finally {
|
||||
if (await fsExtra.exists(zipFilePath)) {
|
||||
await fsExtra.rm(zipFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await main();
|
||||
|
Loading…
x
Reference in New Issue
Block a user