MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / generateDemoTour

Function generateDemoTour

apps/desktop/src/main/vault.ts:3541–3562  ·  view source on GitHub ↗
(root: string)

Source from the content-addressed store, hash-verified

3539}
3540
3541export async function generateDemoTour(root: string): Promise<VaultDemoTourResult> {
3542 await ensureVaultLayout(root)
3543
3544 for (const note of DEMO_TOUR_NOTES) {
3545 const abs = resolveSafe(root, note.path)
3546 await fs.mkdir(path.dirname(abs), { recursive: true })
3547 await fs.writeFile(abs, note.body, 'utf8')
3548 }
3549
3550 for (const asset of DEMO_TOUR_ASSETS) {
3551 const abs = resolveSafe(root, asset.path)
3552 await fs.mkdir(path.dirname(abs), { recursive: true })
3553 await fs.writeFile(abs, asset.body, 'utf8')
3554 }
3555
3556 invalidateNoteMetaCache(root)
3557 invalidateVaultTextSearchCache(root)
3558 return {
3559 notePaths: DEMO_TOUR_NOTES.map((note) => note.path),
3560 assetPaths: DEMO_TOUR_ASSETS.map((asset) => asset.path)
3561 }
3562}
3563
3564export async function removeDemoTour(root: string): Promise<VaultDemoTourResult> {
3565 for (const note of DEMO_TOUR_NOTES) {

Callers 1

registerIpcFunction · 0.90

Calls 4

ensureVaultLayoutFunction · 0.85
invalidateNoteMetaCacheFunction · 0.85
resolveSafeFunction · 0.70

Tested by

no test coverage detected