Fix for directory provider on Windows. Checks for presence of host in URL passed in instead of protocol (false positive).

This commit is contained in:
Paul Aikman
2016-02-16 22:04:33 +00:00
parent cfab689de1
commit b3e8ba350a

View File

@@ -16,8 +16,8 @@ class DefaultDirectoryProvider
# * `null` if the given URI is not compatibile with this provider.
directoryForURISync: (uri) ->
normalizedPath = path.normalize(uri)
{protocol} = url.parse(uri)
directoryPath = if protocol?
host = url.parse(uri).host;
directoryPath = if host
uri
else if not fs.isDirectorySync(normalizedPath) and fs.isDirectorySync(path.dirname(normalizedPath))
path.dirname(normalizedPath)
@@ -26,7 +26,7 @@ class DefaultDirectoryProvider
# TODO: Stop normalizing the path in pathwatcher's Directory.
directory = new Directory(directoryPath)
if protocol?
if host
directory.path = directoryPath
if fs.isCaseInsensitive()
directory.lowerCasePath = directoryPath.toLowerCase()