Skip to content

Commit

Permalink
Update tracking tags to purge and move out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahum committed Nov 22, 2023
1 parent 3698a7f commit f478b49
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/bin/vip-dev-env-purge.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,33 @@ command()
}
}

const trackingInfoChild = getEnvTrackingInfo( slug );

Check failure on line 66 in src/bin/vip-dev-env-purge.js

View workflow job for this annotation

GitHub Actions / Lint

'slug' is not defined
// eslint-disable-next-line no-await-in-loop
await trackEvent( 'dev_env_purge_command_execute', trackingInfoChild );
debug( 'Args: ', arg, 'Options: ', opt );

const removeFiles = ! ( opt.soft || false );

try {
for ( const envName of allEnvNames ) {
const slug = envName;
// eslint-disable-next-line no-await-in-loop
await validateDependencies( lando, slug );
const trackingInfoChild = getEnvTrackingInfo( slug );
// eslint-disable-next-line no-await-in-loop
await trackEvent( 'dev_env_destroy_command_execute', trackingInfoChild );

debug( 'Args: ', arg, 'Options: ', opt );

try {
const removeFiles = ! ( opt.soft || false );
// eslint-disable-next-line no-await-in-loop
await destroyEnvironment( lando, slug, removeFiles );

const message = chalk.green( '✓' ) + ' Environment destroyed.\n';
console.log( message );
// eslint-disable-next-line no-await-in-loop
await trackEvent( 'dev_env_destroy_command_success', trackingInfoChild );
} catch ( error ) {
// eslint-disable-next-line no-await-in-loop
await handleCLIException( error, 'dev_env_destroy_command_error', trackingInfoChild );
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 );
} catch ( error ) {
await handleCLIException( error, 'dev_env_purge_command_error', trackingInfo );
process.exitCode = 1;
Expand Down

0 comments on commit f478b49

Please sign in to comment.