* feat: create mobile curriculum data on build Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
20 lines
606 B
JavaScript
20 lines
606 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const { getChallengesForLang } = require('../../../curriculum/getChallenges');
|
|
const { buildMobileCurriculum } = require('./build-mobile-curriculum');
|
|
|
|
const globalConfigPath = path.resolve(__dirname, '../../../config');
|
|
|
|
// We are defaulting to English because the ids for the challenges are same
|
|
// across all languages.
|
|
getChallengesForLang('english')
|
|
.then(result => {
|
|
buildMobileCurriculum(result);
|
|
return result;
|
|
})
|
|
.then(JSON.stringify)
|
|
.then(json => {
|
|
fs.writeFileSync(`${globalConfigPath}/curriculum.json`, json);
|
|
});
|