@@ -26,17 +26,6 @@ sourceMapSupport.install();
2626mark ( 'After sourceMapSupport install' ) ;
2727
2828const main = async ( ) => {
29- // Parse argv early to check for profiling flag
30- const parsedArgv = await yargs ( hideBin ( process . argv ) )
31- . options ( sharedOptions )
32- . parse ( ) ;
33-
34- // Get config to check for profile setting
35- const config = getConfig ( ) ;
36-
37- // Enable profiling if --profile flag is set or if enabled in config
38- enableProfiling ( Boolean ( parsedArgv . profile ) || Boolean ( config . profile ) ) ;
39-
4029 mark ( 'Main function start' ) ;
4130
4231 dotenv . config ( ) ;
@@ -56,9 +45,11 @@ const main = async () => {
5645 const packageInfo = require ( '../package.json' ) as PackageJson ;
5746 mark ( 'After package.json load' ) ;
5847
48+ console . log ( 'packageInfo' , packageInfo ) ;
49+
5950 // Set up yargs with the new CLI interface
6051 mark ( 'Before yargs setup' ) ;
61- await yargs ( hideBin ( process . argv ) )
52+ const argv = await yargs ( hideBin ( process . argv ) )
6253 . scriptName ( packageInfo . name ! )
6354 . version ( packageInfo . version ! )
6455 . options ( sharedOptions )
@@ -74,6 +65,13 @@ const main = async () => {
7465 . strict ( )
7566 . showHelpOnFail ( true )
7667 . help ( ) . argv ;
68+
69+ // Get config to check for profile setting
70+ const config = getConfig ( ) ;
71+
72+ // Enable profiling if --profile flag is set or if enabled in config
73+ enableProfiling ( Boolean ( argv . profile ) || Boolean ( config . profile ) ) ;
74+ mark ( 'After yargs setup' ) ;
7775} ;
7876
7977await main ( )
0 commit comments