1 | #!/usr/bin/env node
|
2 | import { format } from 'node:util';
|
3 |
|
4 | import { CommanderError, program } from 'commander';
|
5 |
|
6 | import * as app from './dist/esm/app.mjs';
|
7 |
|
8 | app.run(program, process.argv).catch((e) => {
|
9 | if (!(e instanceof CommanderError) && !(e instanceof app.CheckFailed)) {
|
10 | const msg = e instanceof app.ApplicationError ? e.message : format(e);
|
11 | process.stdout.write(msg + '\n');
|
12 |
|
13 | process.exitCode = process.exitCode || 1;
|
14 | }
|
15 | if (e instanceof app.CheckFailed) {
|
16 | process.exitCode = e.exitCode;
|
17 | }
|
18 | });
|