Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/commands/project/delete/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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) {
Expand Down