Merge pull request #4279 from FreeCodeCamp/feature/challenge-dev-mode

Feature in dev mode always pull from disk
This commit is contained in:
Rex Schrader
2015-11-10 10:19:10 -08:00
2 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,10 @@ module.exports = function getChallenges() {
try {
return getFilesFor('challenges')
.map(function(file) {
return require('./challenges/' + file);
var challengeSpec = require('./challenges/' + file);
challengeSpec.fileName = file;
return challengeSpec;
});
} catch (e) {
console.log('error', e);

View File

@ -18,6 +18,7 @@ destroy()
var order = challengeSpec.order;
var block = challengeSpec.name;
var isBeta = !!challengeSpec.isBeta;
var fileName = challengeSpec.fileName;
console.log('parsed %s successfully', block);
// challenge file has no challenges...
@ -37,6 +38,8 @@ destroy()
.toLowerCase()
.replace(/\:/g, '')
.replace(/\s/g, '-');
challenge.fileName = fileName;
challenge.order = order;
challenge.suborder = index + 1;
challenge.block = block;