refactor: remove confusing abstraction

This commit is contained in:
Oliver Eyton-Williams
2020-12-17 15:02:56 +01:00
committed by Mrugesh Mohapatra
parent 7c4e0ec41e
commit 24d9c94fe5
3 changed files with 99 additions and 103 deletions

View File

@@ -2,7 +2,7 @@ const _ = require('lodash');
const {
getChallengesForLang,
createChallengeCreator,
createChallenge,
challengesDir,
getChallengesDirForLang
} = require('../../curriculum/getChallenges');
@@ -10,11 +10,9 @@ const { curriculumLocale } = require('../config/env.json');
exports.localeChallengesRootDir = getChallengesDirForLang(curriculumLocale);
const createChallenge = createChallengeCreator(challengesDir, curriculumLocale);
exports.replaceChallengeNode = () => {
return async function replaceChallengeNode(filePath) {
return await createChallenge(filePath);
return await createChallenge(challengesDir, filePath, curriculumLocale);
};
};