(vault: string, args: ParsedArgs)
| 49 | } |
| 50 | |
| 51 | export async function cmdFolderCreate(vault: string, args: ParsedArgs): Promise<void> { |
| 52 | const target = args.positionals[0] ?? getString(args, 'path') |
| 53 | if (!target) throw new Error('zn folder create requires a folder path like inbox/Work.') |
| 54 | const ref = splitFolderPath(target) |
| 55 | if (!ref.subpath) throw new Error('Cannot create the top-level folder; pick a subpath.') |
| 56 | await createFolder(vault, ref.folder, ref.subpath) |
| 57 | if (getBool(args, 'json')) { |
| 58 | emitJson({ ok: true, folder: ref.folder, subpath: ref.subpath }) |
| 59 | return |
| 60 | } |
| 61 | emitOk(`Created ${ref.folder}/${ref.subpath}`) |
| 62 | } |
| 63 | |
| 64 | export async function cmdFolderRename(vault: string, args: ParsedArgs): Promise<void> { |
| 65 | const oldPath = args.positionals[0] ?? getString(args, 'path') |
nothing calls this directly
no test coverage detected