From c3d3d65145105c15b1cfa69c927067de48a37862 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 26 Mar 2024 16:50:40 -0300 Subject: upd8, write: cleaner buildConfig step fallback logic --- src/upd8.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/upd8.js') diff --git a/src/upd8.js b/src/upd8.js index f955e5f3..96a1e9e8 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -551,18 +551,29 @@ async function main() { logWarn`Redundant option ${cliPart}`; } } else { - if (cliFlagNegates) { - step.status = STATUS_NOT_APPLICABLE; - step.annotation = `--${cliFlag} provided`; - } + step.status = + (cliFlagNegates + ? STATUS_NOT_APPLICABLE + : STATUS_NOT_STARTED); + + step.annotation = `--${cliFlag} provided`; + if (cliFlagWarning) { for (const line of cliFlagWarning.split('\n')) { logWarn(line); } } + + return; } } + if (buildConfig?.required === true) { + step.status = STATUS_NOT_STARTED; + step.annotation = `required for --${selectedBuildModeFlag}`; + return; + } + if (buildConfig?.applicable === false) { step.status = STATUS_NOT_APPLICABLE; step.annotation = `N/A for --${selectedBuildModeFlag}`; @@ -575,6 +586,12 @@ async function main() { return; } + if (buildConfig?.default === 'perform') { + step.status = STATUS_NOT_STARTED; + step.annotation = `default for --${selectedBuildModeFlag}`; + return; + } + switch (defaultValue) { case 'skip': step.status = STATUS_NOT_APPLICABLE; -- cgit 1.3.0-6-gf8a5