MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / createStepFile

Function createStepFile

tools/challenge-helper-scripts/utils.ts:52–71  ·  view source on GitHub ↗
({
  stepNum,
  challengeType,
  challengeId,
  projectPath = getProjectPath(),
  challengeSeeds = [],
  isFirstChallenge = false,
  challengeLang
}: Options)

Source from the content-addressed store, hash-verified

50}
51
52const createStepFile = ({
53 stepNum,
54 challengeType,
55 challengeId,
56 projectPath = getProjectPath(),
57 challengeSeeds = [],
58 isFirstChallenge = false,
59 challengeLang
60}: Options) => {
61 const template = getStepTemplate({
62 challengeId,
63 challengeSeeds,
64 stepNum,
65 challengeType,
66 isFirstChallenge,
67 challengeLang
68 });
69
70 fs.writeFileSync(`${projectPath}${challengeId.toString()}.md`, template);
71};
72
73const createChallengeFile = (
74 filename: string,

Callers 4

insertStepFunction · 0.85
createEmptyStepsFunction · 0.85
createFirstChallengeFunction · 0.85
utils.test.tsFile · 0.85

Calls 2

getProjectPathFunction · 0.85
getStepTemplateFunction · 0.85

Tested by

no test coverage detected