refactor: handle certs separately (#44434)
* refactor: split createChallenge into two functions * refactor: remove certification metas * fix: remove the metas I missed
This commit is contained in:
committed by
GitHub
parent
40acfa708b
commit
9ad29e03d5
@ -6,6 +6,7 @@ const envData = require('../../config/env.json');
|
||||
const {
|
||||
getChallengesForLang,
|
||||
createChallenge,
|
||||
createCertification,
|
||||
challengesDir,
|
||||
getChallengesDirForLang
|
||||
} = require('../../curriculum/getChallenges');
|
||||
@ -25,13 +26,11 @@ exports.replaceChallengeNode = () => {
|
||||
`../../curriculum/challenges/_meta/${blockName}/meta.json`
|
||||
);
|
||||
delete require.cache[require.resolve(metaPath)];
|
||||
const isCert = path.extname(filePath) === '.yml';
|
||||
const meta = require(metaPath);
|
||||
return await createChallenge(
|
||||
challengesDir,
|
||||
filePath,
|
||||
curriculumLocale,
|
||||
meta
|
||||
);
|
||||
return isCert
|
||||
? await createCertification(challengesDir, filePath, curriculumLocale)
|
||||
: await createChallenge(challengesDir, filePath, curriculumLocale, meta);
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user