|
|
|
|
@ -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();
|
|
|
|
|
|