File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1440,7 +1440,7 @@ namespace ts {
1440
1440
1441
1441
const platform : string = _os . platform ( ) ;
1442
1442
const useCaseSensitiveFileNames = isFileSystemCaseSensitive ( ) ;
1443
- const realpathSync = _fs . realpathSync . native ?? _fs . realpathSync ;
1443
+ const fsRealpath = ! ! _fs . realpathSync . native ? process . platform === "win32" ? fsRealPathHandlingLongPath : _fs . realpathSync . native : _fs . realpathSync ;
1444
1444
1445
1445
const fsSupportsRecursiveFsWatch = isNode4OrLater && ( process . platform === "win32" || process . platform === "darwin" ) ;
1446
1446
const getCurrentDirectory = memoize ( ( ) => process . cwd ( ) ) ;
@@ -1889,9 +1889,13 @@ namespace ts {
1889
1889
return getAccessibleFileSystemEntries ( path ) . directories . slice ( ) ;
1890
1890
}
1891
1891
1892
+ function fsRealPathHandlingLongPath ( path : string ) : string {
1893
+ return path . length < 260 ? _fs . realpathSync . native ( path ) : _fs . realpathSync ( path ) ;
1894
+ }
1895
+
1892
1896
function realpath ( path : string ) : string {
1893
1897
try {
1894
- return realpathSync ( path ) ;
1898
+ return fsRealpath ( path ) ;
1895
1899
}
1896
1900
catch {
1897
1901
return path ;
You can’t perform that action at this time.
0 commit comments