fix: watch curriculum changes
This commit is contained in:
@ -29,7 +29,8 @@ exports.sourceNodes = function sourceChallengesSourceNodes(
|
|||||||
const watcher = chokidar.watch(curriculumPath, {
|
const watcher = chokidar.watch(curriculumPath, {
|
||||||
ignored: /(^|[\/\\])\../,
|
ignored: /(^|[\/\\])\../,
|
||||||
persistent: true,
|
persistent: true,
|
||||||
usePolling: true
|
usePolling: true,
|
||||||
|
cwd: curriculumPath
|
||||||
});
|
});
|
||||||
|
|
||||||
watcher.on('change', filePath =>
|
watcher.on('change', filePath =>
|
||||||
@ -45,6 +46,7 @@ File changed at ${filePath}, replacing challengeNode id ${challenge.id}
|
|||||||
})
|
})
|
||||||
.catch(e =>
|
.catch(e =>
|
||||||
reporter.error(`fcc-replace-challenge
|
reporter.error(`fcc-replace-challenge
|
||||||
|
attempting to replace ${filePath}
|
||||||
|
|
||||||
${e.message}
|
${e.message}
|
||||||
|
|
||||||
|
@ -2,16 +2,19 @@ const _ = require('lodash');
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
getChallengesForLang,
|
getChallengesForLang,
|
||||||
createChallenge,
|
createChallengeCreator,
|
||||||
|
challengesDir,
|
||||||
getChallengesDirForLang
|
getChallengesDirForLang
|
||||||
} = require('../../curriculum/getChallenges');
|
} = require('../../curriculum/getChallenges');
|
||||||
const { locale } = require('../config/env.json');
|
const { locale } = require('../config/env.json');
|
||||||
|
|
||||||
exports.localeChallengesRootDir = getChallengesDirForLang(locale);
|
exports.localeChallengesRootDir = getChallengesDirForLang(locale);
|
||||||
|
|
||||||
exports.replaceChallengeNode = locale => {
|
const createChallenge = createChallengeCreator(challengesDir, locale);
|
||||||
return async function replaceChallengeNode(fullFilePath) {
|
|
||||||
return await createChallenge(fullFilePath, null, locale);
|
exports.replaceChallengeNode = () => {
|
||||||
|
return async function replaceChallengeNode(filePath) {
|
||||||
|
return await createChallenge(filePath);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user