File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3- const oclif = require ( ' @oclif/core' )
3+ const oclif = require ( " @oclif/core" ) ;
44
5- const path = require ( ' path' )
6- const project = path . join ( __dirname , '..' , ' tsconfig.json' )
5+ const path = require ( " path" ) ;
6+ const project = path . join ( __dirname , ".." , " tsconfig.json" ) ;
77
88// In dev mode -> use ts-node and dev plugins
9- process . env . NODE_ENV = ' development'
9+ process . env . NODE_ENV = " development" ;
1010
11- require ( ' ts-node' ) . register ( { project} )
11+ require ( " ts-node" ) . register ( { project } ) ;
1212
1313// In dev mode, always show stack traces
1414oclif . settings . debug = true ;
1515
16+ const flush = ( ) => {
17+ const passed = parseInt ( process . env . NS_CLI_FLUSH_TIMEOUT ) ;
18+ const timeout = passed > 0 && ! isNaN ( passed ) ? passed : 100000000 ;
19+ oclif . flush ( Math . min ( timeout * 1000 , 0x7fffffff ) ) ; // setTimeout requires signed 32 bit integer range
20+ } ;
21+
1622// Start the CLI
17- oclif . run ( ) . then ( oclif . flush ) . catch ( oclif . Errors . handle )
23+ oclif . run ( ) . then ( flush ) . catch ( oclif . Errors . handle ) ;
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3- const oclif = require ( ' @oclif/core' )
3+ const oclif = require ( " @oclif/core" ) ;
44
5- oclif . run ( ) . then ( require ( '@oclif/core/flush' ) ) . catch ( require ( '@oclif/core/handle' ) )
5+ const flush = ( ) => {
6+ const passed = parseInt ( process . env . NS_CLI_FLUSH_TIMEOUT ) ;
7+ const timeout = passed > 0 && ! isNaN ( passed ) ? passed : 100000000 ;
8+ require ( "@oclif/core/flush" ) ( Math . min ( timeout * 1000 , 0x7fffffff ) ) ; // setTimeout requires signed 32 bit integer range
9+ } ;
10+
11+ oclif . run ( ) . then ( flush ) . catch ( require ( "@oclif/core/handle" ) ) ;
You can’t perform that action at this time.
0 commit comments