From d6f8e272fc5e17355c16021cf201cb52788f6aa3 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Sun, 7 Mar 2021 10:35:38 +0100 Subject: [PATCH] Add --error debug flag --- source/plugins/core/index.mjs | 10 +++++++--- source/plugins/core/metadata.yml | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/plugins/core/index.mjs b/source/plugins/core/index.mjs index 0f8bdcb6..720b555b 100644 --- a/source/plugins/core/index.mjs +++ b/source/plugins/core/index.mjs @@ -97,15 +97,15 @@ data.meta = {version:conf.package.version, author:conf.package.author} //Debug flags - if ((dflags.includes("--cakeday"))||(dflags.includes("cakeday"))) { + if (dflags.includes("--cakeday")) { console.debug(`metrics/compute/${login} > applying dflag --cakeday`) computed.cakeday = true } - if ((dflags.includes("--hireable"))||(dflags.includes("hireable"))) { + if (dflags.includes("--hireable")) { console.debug(`metrics/compute/${login} > applying dflag --hireable`) data.user.isHireable = true } - if ((dflags.includes("--halloween"))||(dflags.includes("halloween"))) { + if (dflags.includes("--halloween")) { console.debug(`metrics/compute/${login} > applying dflag --halloween`) //Haloween color replacer const halloween = content => content @@ -125,6 +125,10 @@ return {name:"dflag.halloween", result:true} })()) } + if (dflags.includes("--error")) { + console.debug(`metrics/compute/${login} > applying dflag --error`) + throw new Error("Failed as requested by --error flag") + } //Results return null diff --git a/source/plugins/core/metadata.yml b/source/plugins/core/metadata.yml index 81aaa0ff..c4602837 100644 --- a/source/plugins/core/metadata.yml +++ b/source/plugins/core/metadata.yml @@ -187,6 +187,7 @@ inputs: - --cakeday - --hireable - --halloween + - --error # Dry-run mode (perform generation without pushing it) dryrun: