From 59191d581f61d4b8d92c606a77b64df676059e42 Mon Sep 17 00:00:00 2001 From: gikf <60067306+gikf@users.noreply.github.com> Date: Tue, 6 Jul 2021 08:40:53 +0200 Subject: [PATCH] fix(client): allow regex to match windows-like paths (#42720) Co-authored-by: Shaun Hamilton --- client/utils/buildChallenges.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/utils/buildChallenges.js b/client/utils/buildChallenges.js index c704a5f1db..b16d445914 100644 --- a/client/utils/buildChallenges.js +++ b/client/utils/buildChallenges.js @@ -17,7 +17,8 @@ exports.replaceChallengeNode = () => { return async function replaceChallengeNode(filePath) { // get the meta so that challengeOrder is accurate 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( __dirname, `../../curriculum/challenges/_meta/${blockName}/meta.json`