feat: challenge helpers for non-step-based challenges (#50769)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
Naomi Carrigan
2023-07-11 10:32:25 -07:00
committed by GitHub
parent ac48d14f8d
commit a374c2fade
15 changed files with 734 additions and 17 deletions

View File

@@ -31,6 +31,14 @@ const createStepFile = ({
return challengeId;
};
const createChallengeFile = (
title: string,
template: string,
path = getProjectPath()
): void => {
fs.writeFileSync(`${path}${title}.md`, template);
};
interface InsertOptions {
stepNum: number;
stepId: ObjectID;
@@ -98,6 +106,7 @@ const getChallengeSeeds = (
export {
createStepFile,
createChallengeFile,
updateStepTitles,
getChallengeSeeds,
insertStepIntoMeta,