File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1440,7 +1440,7 @@ namespace ts {
14401440
14411441 const platform : string = _os . platform ( ) ;
14421442 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 ;
14441444
14451445 const fsSupportsRecursiveFsWatch = isNode4OrLater && ( process . platform === "win32" || process . platform === "darwin" ) ;
14461446 const getCurrentDirectory = memoize ( ( ) => process . cwd ( ) ) ;
@@ -1889,9 +1889,13 @@ namespace ts {
18891889 return getAccessibleFileSystemEntries ( path ) . directories . slice ( ) ;
18901890 }
18911891
1892+ function fsRealPathHandlingLongPath ( path : string ) : string {
1893+ return path . length < 260 ? _fs . realpathSync . native ( path ) : _fs . realpathSync ( path ) ;
1894+ }
1895+
18921896 function realpath ( path : string ) : string {
18931897 try {
1894- return realpathSync ( path ) ;
1898+ return fsRealpath ( path ) ;
18951899 }
18961900 catch {
18971901 return path ;
You can’t perform that action at this time.
0 commit comments