mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Default directory provider should handle only local filesystem directories
This commit is contained in:
@@ -21,7 +21,10 @@ class DefaultDirectoryProvider
|
||||
else
|
||||
path.dirname(projectPath)
|
||||
|
||||
new Directory(directoryPath)
|
||||
if fs.isDirectorySync(projectPath)
|
||||
return new Directory(directoryPath)
|
||||
else
|
||||
return null
|
||||
|
||||
# Public: Create a Directory that corresponds to the specified URI.
|
||||
#
|
||||
|
||||
@@ -39,6 +39,7 @@ class Project extends Model
|
||||
@emitter = new Emitter
|
||||
@buffers ?= []
|
||||
@rootDirectories = []
|
||||
@packageRootDirectoryPaths = []
|
||||
@repositories = []
|
||||
|
||||
@directoryProviders = [new DefaultDirectoryProvider()]
|
||||
@@ -203,10 +204,12 @@ class Project extends Model
|
||||
for provider in @directoryProviders
|
||||
break if directory = provider.directoryForURISync?(projectPath)
|
||||
if directory is null
|
||||
# This should never happen because DefaultDirectoryProvider should always
|
||||
# return a Directory.
|
||||
throw new Error(projectPath + ' could not be resolved to a directory')
|
||||
@rootDirectories.push(directory)
|
||||
# DefaultDirectoryProvider doesn't handle specific directory protocols
|
||||
# Atom Packages may use packageDirectoryPaths to add thier own paths later.
|
||||
@packageRootDirectoryPaths.push(projectPath)
|
||||
return
|
||||
else
|
||||
@rootDirectories.push(directory)
|
||||
|
||||
repo = null
|
||||
for provider in @repositoryProviders
|
||||
|
||||
Reference in New Issue
Block a user