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 <rdawson@onepathtech.com>
This commit is contained in:
Shaun Hamilton
2020-08-25 13:22:03 -07:00
committed by GitHub
co-authored by Randell Dawson
parent 46e3d75c76
commit 83c6de0144
+4 -1
View File
@@ -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))