(root: string)
| 3539 | } |
| 3540 | |
| 3541 | export 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 | |
| 3564 | export async function removeDemoTour(root: string): Promise<VaultDemoTourResult> { |
| 3565 | for (const note of DEMO_TOUR_NOTES) { |
no test coverage detected