Feature in dev mode always pull from disk

This commit is contained in:
Berkeley Martinez
2015-11-09 17:27:56 -08:00
parent b3174a4ac6
commit c2f3a09d3a
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;