Check if name matches before resolving path

Path resolution hits the filesystem so check for a name
match first.
This commit is contained in:
Kevin Sawicki
2014-09-08 17:27:34 -07:00
parent 408cac4632
commit f6545d4002

View File

@@ -161,6 +161,8 @@ class PackageManager
@emit 'loaded'
loadPackage: (nameOrPath) ->
return pack if pack = @getLoadedPackage(nameOrPath)
if packagePath = @resolvePackagePath(nameOrPath)
name = path.basename(nameOrPath)
return pack if pack = @getLoadedPackage(name)