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

Function cmdDelete

apps/desktop/src/cli/commands/notes.ts:190–203  ·  view source on GitHub ↗
(vault: string, args: ParsedArgs)

Source from the content-addressed store, hash-verified

188}
189
190export async function cmdDelete(vault: string, args: ParsedArgs): Promise<void> {
191 const rel = requirePath(args)
192 if (!getBool(args, 'yes')) {
193 throw new Error(
194 'zn delete is permanent. Re-run with --yes to confirm, or use `zn trash` for the reversible alternative.'
195 )
196 }
197 await deleteNote(vault, rel)
198 if (getBool(args, 'json')) {
199 emitJson({ ok: true, path: rel })
200 return
201 }
202 emitOk(`Deleted ${rel}`)
203}
204
205export async function cmdDuplicate(vault: string, args: ParsedArgs): Promise<void> {
206 const meta = await duplicateNote(vault, requirePath(args))

Callers

nothing calls this directly

Calls 5

requirePathFunction · 0.85
getBoolFunction · 0.85
emitJsonFunction · 0.85
emitOkFunction · 0.85
deleteNoteFunction · 0.50

Tested by

no test coverage detected