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

Function seedVault

tooling/scripts/sidebar-vim-smoke.mjs:74–85  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

72}
73
74async function seedVault(root) {
75 const inbox = join(root, 'inbox')
76 await mkdir(inbox, { recursive: true })
77 await Promise.all(['quick', 'archive', 'trash'].map((d) => mkdir(join(root, d), { recursive: true })))
78 const files = []
79 for (let i = 0; i < NOTE_COUNT; i++) {
80 files.push([join(inbox, `${pad(i)} - note.md`), `# Note ${pad(i)}\n\nBody token note-${i}.\n`])
81 }
82 for (let i = 0; i < files.length; i += 100) {
83 await Promise.all(files.slice(i, i + 100).map(([p, b]) => writeFile(p, b)))
84 }
85}
86async function seedUserData(userDataRoot, vaultRoot) {
87 await mkdir(userDataRoot, { recursive: true })
88 await writeFile(join(userDataRoot, 'zennotes.config.json'), JSON.stringify({

Callers 1

mainFunction · 0.70

Calls 1

padFunction · 0.70

Tested by

no test coverage detected