Added detection for case sensitive file systems
This commit is contained in:
parent
6b25dab5e3
commit
85d589431c
1 changed files with 12 additions and 2 deletions
|
@ -311,9 +311,19 @@ namespace ts {
|
|||
return parseInt(process.version.charAt(1)) >= 4;
|
||||
}
|
||||
|
||||
function isFileSystemCaseSensitive(): boolean {
|
||||
// win32\win64 are case insensitive platforms
|
||||
if (platform === "win32" || platform === "win64") {
|
||||
return false;
|
||||
}
|
||||
|
||||
const upperCaseFilename = _path.basename(__filename).toUpperCase();
|
||||
|
||||
return !fileExists(_path.join(_path.dirname(__filename), upperCaseFilename));
|
||||
}
|
||||
|
||||
const platform: string = _os.platform();
|
||||
// win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive
|
||||
const useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin";
|
||||
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
||||
|
||||
function readFile(fileName: string, encoding?: string): string {
|
||||
if (!fileExists(fileName)) {
|
||||
|
|
Loading…
Reference in a new issue