1 |
#!/usr/bin/env node |
|
2 |
|
16✔ |
3 |
import { run, isCliError } from '../lib/cli.js'; |
16✔ |
4 |
|
16✔ |
5 |
async function perform() { |
|
6 |
try {
|
16✔ |
7 |
await run(); |
16✔ |
8 |
} catch (e) {
|
|
9 |
// output user frendly message if cli error
|
2✔ |
10 |
if (isCliError(e)) {
|
2✔ |
11 |
console.error(e.message || e); |
|
12 |
process.exit(1);
|
2✔ |
13 |
} |
2✔ |
14 |
|
|
15 |
// otherwise re-throw exception
|
× |
16 |
throw e;
|
× |
17 |
} |
× |
18 |
}; |
16✔ |
19 |
|
16✔ |
20 |
perform(); |
16✔ |