Skip to content

Commit a587713

Browse files
doggy8088hansl
authored andcommitted
fix(@angular-devkit/core): Windows path normalize bug
The Windows drive letter could be lower case. This PR fix angular/angular-cli#10328
1 parent 6a9bd36 commit a587713

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/angular_devkit/core/src/virtual-fs/path.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export function normalize(path: string): Path {
204204

205205
// Match absolute windows path.
206206
const original = path;
207-
if (path.match(/^[A-Z]:[\/\\]/)) {
207+
if (path.match(/^[A-Z]:[\/\\]/i)) {
208208
path = '\\' + path[0] + '\\' + path.substr(3);
209209
}
210210

packages/angular_devkit/core/src/virtual-fs/path_spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ describe('path', () => {
7070
expect(normalize('\\a\\b\\c')).toBe('/a/b/c');
7171
expect(normalize('.\\a\\b\\c')).toBe('a/b/c');
7272
expect(normalize('C:\\a\\b\\c')).toBe('/C/a/b/c');
73+
expect(normalize('c:\\a\\b\\c')).toBe('/c/a/b/c');
7374
expect(normalize('A:\\a\\b\\c')).toBe('/A/a/b/c');
7475
expect(() => normalize('A:\\..\\..'))
7576
.toThrow(new InvalidPathException('A:\\..\\..'));

0 commit comments

Comments
 (0)