File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 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';
33
44import { CommanderError , program } from 'commander' ;
55
6- import * as app from './dist/esm/app.mjs' ;
6+ import { ApplicationError , CheckFailed , run } from './dist/esm/app.mjs' ;
77
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 ) ;
1112 process . stdout . write ( msg + '\n' ) ;
1213 // It is possible an explicit exit code was set, use it if it was.
1314 process . exitCode = process . exitCode || 1 ;
1415 }
15- if ( e instanceof app . CheckFailed ) {
16+ if ( e instanceof CheckFailed ) {
1617 process . exitCode = e . exitCode ;
1718 }
1819} ) ;
You can’t perform that action at this time.
0 commit comments