Fix control flow bug
This commit is contained in:
parent
40b6bb4a53
commit
b4c5cf2763
|
@ -137,22 +137,22 @@ async function main() {
|
||||||
program.option("--publish", "deploy newly built artifacts");
|
program.option("--publish", "deploy newly built artifacts");
|
||||||
program.option("--all", "show also unchanged artifacts");
|
program.option("--all", "show also unchanged artifacts");
|
||||||
program.parse(process.argv);
|
program.parse(process.argv);
|
||||||
const plan = await computePlan();
|
let plan = await computePlan();
|
||||||
const filteredPlan = plan.filter(
|
const filteredPlan = plan.filter(
|
||||||
({ desired, local, remote }) => desired !== local || desired !== remote
|
({ desired, local, remote }) => desired !== local || desired !== remote
|
||||||
);
|
);
|
||||||
console.log();
|
console.log();
|
||||||
if (filteredPlan.length === 0) {
|
if (filteredPlan.length === 0) {
|
||||||
console.log(`*** NO CHANGES REQUIRED TO ${plan.length} ARTIFACTS ***`);
|
console.log(`*** NO CHANGES REQUIRED TO ${plan.length} ARTIFACTS ***`);
|
||||||
if (!program.all) {
|
|
||||||
plan = filteredPlan;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
`*** CHANGES REQUIRED TO ${filteredPlan.length} of ${plan.length} ARTIFACTS ***`
|
`*** CHANGES REQUIRED TO ${filteredPlan.length} of ${plan.length} ARTIFACTS ***`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
console.log();
|
console.log();
|
||||||
|
if (!program.all) {
|
||||||
|
plan = filteredPlan;
|
||||||
|
}
|
||||||
if (plan.length === 0) {
|
if (plan.length === 0) {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue