Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/angular_devkit/core/src/virtual-fs/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export function noCacheNormalize(path: string): Path {
// Match absolute windows path.
const original = path;
if (path.match(/^[A-Z]:[/\\]/i)) {
path = '\\' + path[0] + '\\' + path.slice(3);
path = '\\' + path[0].toUpperCase() + '\\' + path.slice(3);
}

// We convert Windows paths as well here.
Expand Down
9 changes: 5 additions & 4 deletions packages/angular_devkit/core/src/virtual-fs/path_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('path', () => {
expect(normalize('\\a\\b\\c')).toBe('/a/b/c');
expect(normalize('.\\a\\b\\c')).toBe('a/b/c');
expect(normalize('C:\\a\\b\\c')).toBe('/C/a/b/c');
expect(normalize('c:\\a\\b\\c')).toBe('/c/a/b/c');
expect(normalize('c:\\a\\b\\c')).toBe('/C/a/b/c');
expect(normalize('A:\\a\\b\\c')).toBe('/A/a/b/c');
expect(() => normalize('A:\\..\\..')).toThrow(new InvalidPathException('A:\\..\\..'));
expect(normalize('\\.\\a\\b\\c')).toBe('/a/b/c');
Expand Down Expand Up @@ -131,6 +131,7 @@ describe('path', () => {
['/src/app/sub1/test1', '/src/app/sub2/test2', '../../sub2/test2'],
['/', '/a/b/c', 'a/b/c'],
['/a/b/c', '/d', '../../../d'],
['E:\\abc', 'e:\\abc\\def', 'def'],
];

for (const [from, to, result] of tests) {
Expand Down Expand Up @@ -161,8 +162,8 @@ describe('path', () => {
});

it('asWindowsPath', () => {
expect(asWindowsPath(normalize('c:/'))).toBe('c:\\');
expect(asWindowsPath(normalize('c:/b/'))).toBe('c:\\b');
expect(asWindowsPath(normalize('c:/b/c'))).toBe('c:\\b\\c');
expect(asWindowsPath(normalize('c:/'))).toBe('C:\\');
expect(asWindowsPath(normalize('c:/b/'))).toBe('C:\\b');
expect(asWindowsPath(normalize('c:/b/c'))).toBe('C:\\b\\c');
});
});
Loading