fix(tools): update helper scripts (#41923)

This commit is contained in:
Oliver Eyton-Williams
2021-04-27 20:29:49 +02:00
committed by GitHub
parent 300ff756ce
commit 17a7a84b48
4 changed files with 13 additions and 18 deletions

View File

@ -85,6 +85,7 @@ ${seedTails}`
id: ${ObjectID.generate()}
title: Part ${stepNum}
challengeType: 0
dashedName: part-${stepNum}
---
# --description--
@ -176,11 +177,13 @@ const reorderSteps = () => {
const challengeID = frontMatter.data.id || ObjectID.generate();
const title =
newFileName === 'final.md' ? 'Final Prototype' : `Part ${newStepNum}`;
const dashedName = `part-${newStepNum}`;
challengeOrder.push(['' + challengeID, title]);
const newData = {
...frontMatter.data,
id: challengeID,
title
title,
dashedName
};
fs.writeFileSync(filePath, frontMatter.stringify(newData));
});