mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 10:32:27 +08:00
chore(edit-demo): export root instead
This commit is contained in:
parent
9590f5362e
commit
9c83738a16
@ -1,18 +1,13 @@
|
|||||||
import { extractZip, importData, initializeDatabase, startElectron } from "./electron-utils.js";
|
import { extractZip, initializeDatabase, startElectron } from "./electron-utils.js";
|
||||||
import { initializeTranslations } from "./src/services/i18n.js";
|
import { initializeTranslations } from "./src/services/i18n.js";
|
||||||
import fs from "fs";
|
|
||||||
import debounce from "./src/public/app/services/debounce.js";
|
import debounce from "./src/public/app/services/debounce.js";
|
||||||
|
|
||||||
const DEMO_NOTE_ID = "demo";
|
|
||||||
const DEMO_ZIP_PATH = "db/demo.zip";
|
const DEMO_ZIP_PATH = "db/demo.zip";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
await initializeTranslations();
|
await initializeTranslations();
|
||||||
await initializeDatabase();
|
await initializeDatabase();
|
||||||
|
|
||||||
const demoBuffer = fs.readFileSync(DEMO_ZIP_PATH);
|
|
||||||
await importData(demoBuffer, DEMO_NOTE_ID, "Demo", "The sub-children of this note are automatically synced.");
|
|
||||||
|
|
||||||
await startElectron();
|
await startElectron();
|
||||||
await registerHandlers();
|
await registerHandlers();
|
||||||
}
|
}
|
||||||
@ -38,7 +33,7 @@ async function registerHandlers() {
|
|||||||
|
|
||||||
async function exportData() {
|
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(DEMO_NOTE_ID, "html", DEMO_ZIP_PATH);
|
await exportToZipFile("root", "html", DEMO_ZIP_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
await main();
|
await main();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user