(vault: string, args: ParsedArgs)
| 188 | } |
| 189 | |
| 190 | export 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 | |
| 205 | export async function cmdDuplicate(vault: string, args: ParsedArgs): Promise<void> { |
| 206 | const meta = await duplicateNote(vault, requirePath(args)) |
nothing calls this directly
no test coverage detected