From b3e8ba350ab372ea45f9e1826176c886ef43ed10 Mon Sep 17 00:00:00 2001 From: Paul Aikman Date: Tue, 16 Feb 2016 22:04:33 +0000 Subject: [PATCH 1/2] Fix for directory provider on Windows. Checks for presence of host in URL passed in instead of protocol (false positive). --- src/default-directory-provider.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/default-directory-provider.coffee b/src/default-directory-provider.coffee index 6b05a582f..094522980 100644 --- a/src/default-directory-provider.coffee +++ b/src/default-directory-provider.coffee @@ -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() From 17a2bec3966b2614f4574795d24aecd21f0e696c Mon Sep 17 00:00:00 2001 From: Paul Aikman Date: Wed, 17 Feb 2016 16:20:45 +0000 Subject: [PATCH 2/2] Fix for linter error on CI build. --- src/default-directory-provider.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/default-directory-provider.coffee b/src/default-directory-provider.coffee index 094522980..ed4e9ba36 100644 --- a/src/default-directory-provider.coffee +++ b/src/default-directory-provider.coffee @@ -16,7 +16,7 @@ class DefaultDirectoryProvider # * `null` if the given URI is not compatibile with this provider. directoryForURISync: (uri) -> normalizedPath = path.normalize(uri) - host = url.parse(uri).host; + {host} = url.parse(uri) directoryPath = if host uri else if not fs.isDirectorySync(normalizedPath) and fs.isDirectorySync(path.dirname(normalizedPath))