From 83c6de01444b046095aaf4ac9fdeee6dc031acb0 Mon Sep 17 00:00:00 2001 From: Shaun Hamilton <51722130+Sky020@users.noreply.github.com> Date: Tue, 25 Aug 2020 21:22:03 +0100 Subject: [PATCH] fix: add backslash to path test for windows paths (#39454) * fix: add backslash to path test for windows paths * fix: add posix seperator to path tester Co-authored-by: Randell Dawson --- curriculum/getChallenges.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/curriculum/getChallenges.js b/curriculum/getChallenges.js index eabd1e01e5..a5815cc8ab 100644 --- a/curriculum/getChallenges.js +++ b/curriculum/getChallenges.js @@ -175,7 +175,10 @@ Trying to parse ${fullPath}`); exports.createChallenge = createChallenge; function getEnglishPath(fullPath) { - const posix = path.posix.normalize(fullPath); + const posix = path + .normalize(fullPath) + .split(path.sep) + .join(path.posix.sep); const match = posix.match(/(.*curriculum\/challenges\/)([^/]*)(.*)(\2)(.*)/); const lang = getChallengeLang(fullPath); if (!isAcceptedLanguage(lang))