mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(edit-demo): path to extracted files
This commit is contained in:
parent
099e73b114
commit
6264b9a60a
@ -4,7 +4,9 @@ import debounce from "@triliumnext/client/src/services/debounce.js";
|
|||||||
import fs from "fs/promises";
|
import fs from "fs/promises";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
|
|
||||||
|
// Paths are relative to apps/edit-docs/dist.
|
||||||
const DEMO_ZIP_PATH = join(__dirname, "../../server/src/assets/db/demo.zip");
|
const DEMO_ZIP_PATH = join(__dirname, "../../server/src/assets/db/demo.zip");
|
||||||
|
const OUTPUT_DIR = join(__dirname, "../demo");
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const initializedPromise = startElectron(() => {
|
const initializedPromise = startElectron(() => {
|
||||||
@ -25,9 +27,8 @@ async function registerHandlers() {
|
|||||||
eraseService.eraseUnusedAttachmentsNow();
|
eraseService.eraseUnusedAttachmentsNow();
|
||||||
await exportData();
|
await exportData();
|
||||||
|
|
||||||
const outputDir = "demo";
|
await fs.rmdir(OUTPUT_DIR, { recursive: true }).catch(() => {});
|
||||||
await fs.rmdir(outputDir, { recursive: true }).catch(() => {});
|
await extractZip(DEMO_ZIP_PATH, OUTPUT_DIR);
|
||||||
await extractZip(DEMO_ZIP_PATH, outputDir);
|
|
||||||
}, 10_000);
|
}, 10_000);
|
||||||
events.subscribe(events.ENTITY_CHANGED, async (e) => {
|
events.subscribe(events.ENTITY_CHANGED, async (e) => {
|
||||||
if (e.entityName === "options") {
|
if (e.entityName === "options") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user