File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -299,21 +299,20 @@ module.exports = async (ipc, argv = Bare.argv.slice(1)) => {
299
299
return program
300
300
301
301
function explain ( bail ) {
302
- const code = bail . err . code
303
302
if ( bail . err ) {
304
303
const known = errors . known ( )
305
- if ( known . includes ( code ) === false ) {
304
+ if ( known . includes ( bail . err . code ) === false ) {
306
305
print ( bail . reason , false )
307
306
print ( errors . ERR_UNKNOWN ( 'Unknown [ code: ' + ( bail . err . code || '(none)' ) + ' ] ' + bail . err . stack ) , false )
308
307
Bare . exit ( 1 )
309
308
}
310
309
}
311
310
const reason = bail . reason === 'UNKNOWN_FLAG'
312
311
? 'Unrecognized Flag: --' + bail . flag . name
313
- : ( bail . reason === 'UNKNOWN_ARG' ? 'Unrecognized Argument at index ' + bail . arg . index + ' with value " ' + bail . arg . value + '"' : bail . reason )
312
+ : ( bail . reason === 'UNKNOWN_ARG' ? 'Unrecognized Argument at index ' + bail . arg . index + ' with value ' + bail . arg . value : bail . reason )
314
313
315
314
print ( reason , false )
316
- if ( code === 'ERR_LEGACY' ) return
315
+ if ( bail . err ?. code === 'ERR_LEGACY' ) return
317
316
print ( '\n' + bail . command . usage ( ) )
318
317
}
319
318
}
You can’t perform that action at this time.
0 commit comments