diff --git a/src/commands/project/delete/source.ts b/src/commands/project/delete/source.ts index 567bedb7..9366dd28 100644 --- a/src/commands/project/delete/source.ts +++ b/src/commands/project/delete/source.ts @@ -317,14 +317,10 @@ Update the .forceignore file and try again.`); // fire predeploy event for the delete await Lifecycle.getInstance().emit('predeploy', this.components); - const stages = new DeployStages({ - title: 'Deleting Metadata', - jsonEnabled: this.jsonEnabled(), - }); - const isRest = (await resolveApi()) === API['REST']; - stages.update({ message: `Deleting with ${isRest ? 'REST' : 'SOAP'} API` }); + // Start the progress output only once the deploy is sent, so a delete refused before it is sent + // shows just its error. const deploy = await this.componentSet.deploy({ usernameOrConnection: this.org.getUsername() as string, apiOptions: { @@ -335,6 +331,11 @@ Update the .forceignore file and try again.`); }, }); + const stages = new DeployStages({ + title: 'Deleting Metadata', + jsonEnabled: this.jsonEnabled(), + }); + stages.update({ message: `Deleting with ${isRest ? 'REST' : 'SOAP'} API` }); stages.start({ deploy, username: this.org.getUsername() }); this.deployResult = await deploy.pollStatus({ timeout: this.flags.wait }); if (!deploy.id) {