From b4c5cf2763ec534e9c4ca8892b34f8a3cad36d05 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Thu, 31 Dec 2020 22:58:55 -0800 Subject: [PATCH] Fix control flow bug --- tools/plan-publish.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/plan-publish.js b/tools/plan-publish.js index a0a082e..893ba87 100644 --- a/tools/plan-publish.js +++ b/tools/plan-publish.js @@ -137,22 +137,22 @@ async function main() { program.option("--publish", "deploy newly built artifacts"); program.option("--all", "show also unchanged artifacts"); program.parse(process.argv); - const plan = await computePlan(); + let plan = await computePlan(); const filteredPlan = plan.filter( ({ desired, local, remote }) => desired !== local || desired !== remote ); console.log(); if (filteredPlan.length === 0) { console.log(`*** NO CHANGES REQUIRED TO ${plan.length} ARTIFACTS ***`); - if (!program.all) { - plan = filteredPlan; - } } else { console.log( `*** CHANGES REQUIRED TO ${filteredPlan.length} of ${plan.length} ARTIFACTS ***` ); } console.log(); + if (!program.all) { + plan = filteredPlan; + } if (plan.length === 0) { process.exit(0); }