Skip to content

Commit 515bf07

Browse files
committed
improve error handling
1 parent fe489e1 commit 515bf07

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/cli/bin/run.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
import process from 'node:process';
33
import semver from 'semver';
4-
import { execute } from '@oclif/core';
4+
import { flush, handle, run } from '@oclif/core';
55
import { nodeVersion } from '../dist/version.js';
66

77
if (!semver.satisfies(process.version, nodeVersion)) {
@@ -11,4 +11,6 @@ if (!semver.satisfies(process.version, nodeVersion)) {
1111
process.exit(1);
1212
}
1313

14-
await execute({ dir: import.meta.url });
14+
await run(process.argv.slice(2), import.meta.url)
15+
.catch(async error => handle(error))
16+
.finally(async () => flush());

0 commit comments

Comments
 (0)