Revert "fix(compiler-cli): isCaseSensitive() returns correct value (#36968)" (#37003)

This reverts commit 4becc1bc9531b79e0d834e453981655897571bdf.

The changes to the case-sensitivity handling in #36968 caused multiple
projects to fail to build. See #36992, #36993 and #37000.

The issue is related to the logical path handling. But it is felt that
it is safer to revert the entire PR and then to investigate further.

PR Close #37003
This commit is contained in:
Pete Bacon Darwin 2020-05-08 13:34:00 +01:00 committed by Alex Rickabaugh
parent 00cc02fb0c
commit 0fc0d9bb3d
2 changed files with 9 additions and 18 deletions

View File

@ -68,9 +68,7 @@ export class NodeJSFileSystem implements FileSystem {
}
isCaseSensitive(): boolean {
if (this._caseSensitive === undefined) {
// Note the use of the real file-system is intentional:
// `this.exists()` relies upon `isCaseSensitive()` so that would cause an infinite recursion.
this._caseSensitive = !fs.existsSync(togglePathCase(__filename));
this._caseSensitive = this.exists(togglePathCase(__filename));
}
return this._caseSensitive;
}

View File

@ -153,6 +153,14 @@ describe('NodeJSFileSystem', () => {
expect(mkdirCalls).toEqual([xPath, xyPath, xyzPath]);
});
describe('removeDeep()', () => {
it('should delegate to fsExtra.remove()', () => {
const spy = spyOn(fsExtra, 'removeSync');
fs.removeDeep(abcPath);
expect(spy).toHaveBeenCalledWith(abcPath);
});
});
it('should not fail if a directory (that did not exist before) does exist when trying to create it',
() => {
let abcPathExists = false;
@ -220,19 +228,4 @@ describe('NodeJSFileSystem', () => {
expect(isDirectorySpy).toHaveBeenCalledTimes(1);
});
});
describe('removeDeep()', () => {
it('should delegate to fsExtra.remove()', () => {
const spy = spyOn(fsExtra, 'removeSync');
fs.removeDeep(abcPath);
expect(spy).toHaveBeenCalledWith(abcPath);
});
});
describe('isCaseSensitive()', () => {
it('should return true if the FS is case-sensitive', () => {
const isCaseSensitive = !realFs.existsSync(__filename.toUpperCase());
expect(fs.isCaseSensitive()).toEqual(isCaseSensitive);
});
});
});