Skip to content

Commit 0c000e8

Browse files
committed
Merge remote-tracking branch 'tf/bug-mac-osx-case-sensitive' into vladima/fs-case-sensitivity
2 parents 4800464 + 33a2c0b commit 0c000e8

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/compiler/sys.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,19 @@ namespace ts {
311311
return parseInt(process.version.charAt(1)) >= 4;
312312
}
313313

314+
function isFileSystemCaseSensitive(): boolean {
315+
// win32\win64 are case insensitive platforms
316+
if (platform === "win32" || platform === "win64") {
317+
return false;
318+
}
319+
320+
const upperCaseFilename = _path.basename(__filename).toUpperCase();
321+
322+
return !fileExists(_path.join(_path.dirname(__filename), upperCaseFilename));
323+
}
324+
314325
const platform: string = _os.platform();
315-
// win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive
316-
const useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin";
326+
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
317327

318328
function readFile(fileName: string, encoding?: string): string {
319329
if (!fileExists(fileName)) {

0 commit comments

Comments
 (0)