(dirArg: string | undefined)
| 52 | } |
| 53 | |
| 54 | export function resolveProject(dirArg: string | undefined): ProjectDir { |
| 55 | try { |
| 56 | return resolveProjectOrThrow(dirArg); |
| 57 | } catch (err) { |
| 58 | if (err instanceof InvalidProjectError) { |
| 59 | // Self-exit (not a throw) so the cli.ts wrapper never sees it — report |
| 60 | // inline. argv[2] is the running command (info / inspect / render / ...). |
| 61 | // This is the dominant failure for read-only commands like `info` run |
| 62 | // outside a project; the redaction in trackCliError strips the dir path. |
| 63 | trackCommandFailure(process.argv[2] ?? "unknown", err); |
| 64 | errorBox(err.title, err.hint, err.suggestion); |
| 65 | process.exit(1); |
| 66 | } |
| 67 | throw err; |
| 68 | } |
| 69 | } |
no test coverage detected