Skip to content

Commit

Permalink
Move trackinginfo around
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahum committed Nov 22, 2023
1 parent d20d512 commit 2266e34
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/bin/vip-dev-env-purge.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ command()

const allEnvNames = getAllEnvironmentNames();
const lando = await bootstrapLando();
const trackingInfo = { all: true };
await trackEvent( 'dev_env_purge_command_execute', trackingInfo );

if ( allEnvNames.length === 0 ) {
console.log( 'No environments to purge!' );
Expand All @@ -65,9 +63,9 @@ command()
}
}

const trackingInfoChild = getEnvTrackingInfo( slug );
const trackingInfo = { all: true };
// eslint-disable-next-line no-await-in-loop
await trackEvent( 'dev_env_purge_command_execute', trackingInfoChild );
await trackEvent( 'dev_env_purge_command_execute', trackingInfo );

// eslint-disable-next-line no-await-in-loop
await validateDependencies( lando, '' );
Expand All @@ -83,13 +81,14 @@ command()
const message = chalk.green( '✓' ) + ' Environment destroyed.\n';
console.log( message );
} catch ( error ) {
const trackingInfoChild = getEnvTrackingInfo( slug );
// eslint-disable-next-line no-await-in-loop
await handleCLIException( error, 'dev_env_purge_command_error', trackingInfoChild );
process.exitCode = 1;
}
}
// eslint-disable-next-line no-await-in-loop
await trackEvent( 'dev_env_purge_command_success', trackingInfoChild );
await trackEvent( 'dev_env_purge_command_success', trackingInfo );
} catch ( error ) {
await handleCLIException( error, 'dev_env_purge_command_error', trackingInfo );
process.exitCode = 1;
Expand Down

0 comments on commit 2266e34

Please sign in to comment.