Skip to content

Commit

Permalink
revert changes to deploy.js
Browse files Browse the repository at this point in the history
  • Loading branch information
anthmatic committed Sep 24, 2021
1 parent 7706201 commit 1220b11
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions packages/cli/commands/project/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,27 @@ exports.handler = async options => {
logger.error('No latest build ID was found.');
return;
};
const deployedBuildId = buildId || (await getBuildId());
let deployId;

try {
const deployedBuildId = buildId || (await getBuildId());

const deployResp = await deployProject(
accountId,
projectConfig.name,
deployedBuildId
);

deployId = deployResp.deployId;

if (deployResp.error) {
logger.error(`Deploy error: ${deployResp.error.message}`);
return;
}

await pollDeployStatus(
accountId,
projectConfig.name,
deployResp.deployId,
deployedBuildId
);
} catch (e) {
if (e.statusCode === 400) {
logger.error(e.error.message);
Expand All @@ -89,17 +94,6 @@ exports.handler = async options => {
);
}
}

try {
await pollDeployStatus(
accountId,
projectConfig.name,
deployId,
deployedBuildId
);
} catch (err) {
logger.error(err);
}
};

exports.builder = yargs => {
Expand Down

0 comments on commit 1220b11

Please sign in to comment.