From cefb973c14f6115f270fba99475b00f3bd483b82 Mon Sep 17 00:00:00 2001 From: Shaun Hamilton Date: Wed, 21 Jul 2021 17:14:22 +0100 Subject: [PATCH] fix(tools): fix insert-erms helper script (#42903) * fix(tools): fix insert-erms helper script * only throw if undefined erms * revert last two commits * fix insertErms the correct way --- tools/challenge-helper-scripts/helpers/get-step-template.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/challenge-helper-scripts/helpers/get-step-template.js b/tools/challenge-helper-scripts/helpers/get-step-template.js index 981ffdfa98..dee294f2ec 100644 --- a/tools/challenge-helper-scripts/helpers/get-step-template.js +++ b/tools/challenge-helper-scripts/helpers/get-step-template.js @@ -27,7 +27,10 @@ function getStepTemplate({ }) { const seedTexts = Object.values(challengeSeeds) .map(({ contents, ext, editableRegionBoundaries }) => { - const fullContents = insertErms(contents, editableRegionBoundaries); + let fullContents = contents; + if (editableRegionBoundaries.length >= 2) { + fullContents = insertErms(contents, editableRegionBoundaries); + } return getCodeBlock(ext, fullContents); }) .join('\n');