File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -311,9 +311,18 @@ namespace ts {
311
311
return parseInt ( process . version . charAt ( 1 ) ) >= 4 ;
312
312
}
313
313
314
+ function isFileSystemCaseSensitive ( ) : boolean {
315
+ // win32\win64 are case insensitive platforms
316
+ if ( platform === "win32" || platform === "win64" ) {
317
+ return false ;
318
+ }
319
+ // convert current file name to upper case / lower case and check if file exists
320
+ // (guards against cases when name is already all uppercase or lowercase)
321
+ return ! fileExists ( __filename . toUpperCase ( ) ) || ! fileExists ( __filename . toLowerCase ( ) ) ;
322
+ }
323
+
314
324
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" ;
325
+ const useCaseSensitiveFileNames = isFileSystemCaseSensitive ( ) ;
317
326
318
327
function readFile ( fileName : string , encoding ?: string ) : string {
319
328
if ( ! fileExists ( fileName ) ) {
You can’t perform that action at this time.
0 commit comments