Fixed path parsing bugs that affect Windows platform.

This commit is contained in:
Eric Traut 2019-09-26 00:15:05 -07:00
parent 168629cc92
commit 4bc97471d9

View File

@ -273,12 +273,12 @@ export function getWildcardRegexPattern(rootPath: string, fileSpec: string): str
let regExPattern = '';
let firstComponent = true;
for (const component of pathComponents) {
for (let component of pathComponents) {
if (component === '**') {
regExPattern += doubleAsteriskRegexFragment;
} else {
if (!firstComponent) {
regExPattern += '/';
component = path.sep + component;
}
regExPattern += component.replace(
@ -316,7 +316,7 @@ export function getWildcardRoot(rootPath: string, fileSpec: string): string {
let wildcardRoot = '';
let firstComponent = true;
for (const component of pathComponents) {
for (let component of pathComponents) {
if (component === '**') {
break;
} else {
@ -325,7 +325,7 @@ export function getWildcardRoot(rootPath: string, fileSpec: string): string {
}
if (!firstComponent) {
wildcardRoot += '/';
component = path.sep + component;
}
wildcardRoot += component;