Skip to content

Commit 19a4dbd

Browse files
committed
fix
1 parent 41d2c52 commit 19a4dbd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/aws-cdk/lib/api/deploy-stack.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,13 @@ export async function deployStack(options: DeployStackOptions): Promise<DeploySt
262262
? templateParams.updateExisting(finalParameterValues, cloudFormationStack.parameters)
263263
: templateParams.supplyAll(finalParameterValues);
264264

265+
const hotswapMode = options.hotswap ?? HotswapMode.FULL_DEPLOYMENT;
266+
265267
if (await canSkipDeploy(options, cloudFormationStack, stackParams.hasChanges(cloudFormationStack.parameters))) {
266268
debug(`${deployName}: skipping deployment (use --force to override)`);
267269
// if we can skip deployment and we are performing a hotswap, let the user know
268270
// that no hotswap deployment happened
269-
if (options.hotswap !== HotswapMode.FULL_DEPLOYMENT) {
271+
if (hotswapMode !== HotswapMode.FULL_DEPLOYMENT) {
270272
print(`\n ${ICON} %s\n`, chalk.bold('hotswap deployment skipped - no changes were detected (use --force to override)'));
271273
}
272274
return {
@@ -289,8 +291,7 @@ export async function deployStack(options: DeployStackOptions): Promise<DeploySt
289291
parallel: options.assetParallelism,
290292
});
291293

292-
const hotswapMode = options.hotswap;
293-
if (hotswapMode && hotswapMode !== HotswapMode.FULL_DEPLOYMENT) {
294+
if (hotswapMode !== HotswapMode.FULL_DEPLOYMENT) {
294295
// attempt to short-circuit the deployment if possible
295296
try {
296297
const hotswapDeploymentResult = await tryHotswapDeployment(

0 commit comments

Comments
 (0)