mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-19 18:18:27 -05:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user