fix(client): allow regex to match windows-like paths (#42720)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
@ -17,7 +17,8 @@ exports.replaceChallengeNode = () => {
|
|||||||
return async function replaceChallengeNode(filePath) {
|
return async function replaceChallengeNode(filePath) {
|
||||||
// get the meta so that challengeOrder is accurate
|
// get the meta so that challengeOrder is accurate
|
||||||
const blockNameRe = /\d\d-[-\w]+\/([^/]+)\//;
|
const blockNameRe = /\d\d-[-\w]+\/([^/]+)\//;
|
||||||
const blockName = filePath.match(blockNameRe)[1];
|
const posix = path.normalize(filePath).split(path.sep).join(path.posix.sep);
|
||||||
|
const blockName = posix.match(blockNameRe)[1];
|
||||||
const metaPath = path.resolve(
|
const metaPath = path.resolve(
|
||||||
__dirname,
|
__dirname,
|
||||||
`../../curriculum/challenges/_meta/${blockName}/meta.json`
|
`../../curriculum/challenges/_meta/${blockName}/meta.json`
|
||||||
|
Reference in New Issue
Block a user