fix(pkg): Reintroduce build step

This commit is contained in:
Bouncey
2018-10-05 12:20:51 +01:00
committed by Stuart Taylor
parent e34ff2e3ff
commit bcd0e82348
6 changed files with 2867 additions and 49 deletions

29
curriculum/gulpfile.js Normal file
View File

@ -0,0 +1,29 @@
const fs = require('fs-extra');
const gulp = require('gulp');
const { getChallengesForLang } = require('./getChallenges');
const { supportedLangs } = require('./utils');
function generateCurricula(done) {
const promises = supportedLangs.map(lang => getChallengesForLang(lang));
return Promise.all(promises)
.then(allLangCurriculum =>
allLangCurriculum.reduce(
(map, current, i) => ({ ...map, [supportedLangs[i]]: current }),
{}
)
)
.then(curricula =>
fs.writeFile('./curricula.json', JSON.stringify(curricula))
)
.then(done);
}
function watchFiles() {
return gulp.watch('./challenges/**/*.md', generateCurricula);
}
const defaultTask = gulp.series(generateCurricula, watchFiles);
gulp.task('default', defaultTask);
gulp.task('build', generateCurricula);