feat: refactor and test tools steps utilities (#42693)

This commit is contained in:
Victor Duarte
2021-07-06 19:22:12 -05:00
committed by GitHub
parent 9e883e49ba
commit 82d09bd593
36 changed files with 855 additions and 207 deletions

View File

@ -0,0 +1,22 @@
const path = require('path');
// Returns the path of the meta file associated to arguments provided.
const getProjectMetaPath = (curriculumPath, projectName) => {
if (typeof curriculumPath !== 'string' || typeof projectName !== 'string') {
throw `${curriculumPath} and ${projectName} should be of type string`;
}
if (!projectName) {
throw `${projectName} can't be an empty string`;
}
return path.resolve(
curriculumPath,
'challenges',
'_meta',
projectName,
'meta.json'
);
};
exports.getProjectMetaPath = getProjectMetaPath;