File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,17 @@ import { format } from 'node:util';
3
3
4
4
import { CommanderError , program } from 'commander' ;
5
5
6
- import * as app from './dist/esm/app.mjs' ;
6
+ import { ApplicationError , CheckFailed , run } from './dist/esm/app.mjs' ;
7
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 ) ;
8
+ run ( program , process . argv ) . catch ( ( e ) => {
9
+ if ( ! ( e instanceof CommanderError ) && ! ( e instanceof CheckFailed ) ) {
10
+ const verbose = process . argv . includes ( '--verbose' ) || process . argv . includes ( '-v' ) ;
11
+ const msg = ! verbose && e instanceof ApplicationError ? e . message : format ( e ) ;
11
12
process . stdout . write ( msg + '\n' ) ;
12
13
// It is possible an explicit exit code was set, use it if it was.
13
14
process . exitCode = process . exitCode || 1 ;
14
15
}
15
- if ( e instanceof app . CheckFailed ) {
16
+ if ( e instanceof CheckFailed ) {
16
17
process . exitCode = e . exitCode ;
17
18
}
18
19
} ) ;
You can’t perform that action at this time.
0 commit comments