@@ -63,7 +63,7 @@ export default new Command()
6363 . action ( async function ( options ) {
6464 const ora = Ora ( ) ;
6565 const flags = parseFlags ( options ) ;
66- let authId : string | null = null ;
66+ let email : string | null = null ;
6767
6868 try {
6969 ora . start ( "Loading configuration..." ) ;
@@ -76,7 +76,7 @@ export default new Command()
7676 ora . start ( "Checking authentication status..." ) ;
7777 const auth = await tryAuthenticate ( settings ) ;
7878 if ( auth ) {
79- authId = auth . id ;
79+ email = auth . email ;
8080 ora . succeed ( `Authenticated as ${ auth . email } ` ) ;
8181 } else {
8282 ora . info (
@@ -92,10 +92,11 @@ export default new Command()
9292 ora . succeed ( "Localization configuration is valid" ) ;
9393
9494 // Track event with or without authentication
95- trackEvent ( authId , "cmd.status.start" , {
95+ trackEvent ( email , "cmd.status.start" , {
9696 i18nConfig,
9797 flags,
9898 } ) ;
99+ await new Promise ( ( resolve ) => setTimeout ( resolve , 50 ) ) ;
99100
100101 let buckets = getBuckets ( i18nConfig ! ) ;
101102 if ( flags . bucket ?. length ) {
@@ -628,22 +629,22 @@ export default new Command()
628629 }
629630
630631 // Track successful completion
631- trackEvent ( authId , "cmd.status.success" , {
632+ trackEvent ( email , "cmd.status.success" , {
632633 i18nConfig,
633634 flags,
634635 totalSourceKeyCount,
635636 languageStats,
636637 totalWordsToTranslate,
637- authenticated : ! ! authId ,
638+ authenticated : ! ! email ,
638639 } ) ;
639640 await new Promise ( ( resolve ) => setTimeout ( resolve , 50 ) ) ;
640641 exitGracefully ( ) ;
641642 } catch ( error : any ) {
642643 ora . fail ( error . message ) ;
643- trackEvent ( authId , "cmd.status.error" , {
644+ trackEvent ( email , "cmd.status.error" , {
644645 flags,
645646 error : error . message ,
646- authenticated : ! ! authId ,
647+ authenticated : ! ! email ,
647648 } ) ;
648649 await new Promise ( ( resolve ) => setTimeout ( resolve , 50 ) ) ;
649650 process . exit ( 1 ) ;
0 commit comments