mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-03 20:33:33 +03:00
Don't load packages starting with dot. Fixes #9805
This commit is contained in:
parent
7d13ba5d4e
commit
49fb287592
@ -66,6 +66,9 @@ describe "PackageManager", ->
|
||||
expect(addErrorHandler.argsForCall[0][0].message).toContain("Failed to load the package-with-broken-package-json package")
|
||||
expect(addErrorHandler.argsForCall[0][0].options.packageName).toEqual "package-with-broken-package-json"
|
||||
|
||||
it "returns null if the package name or path starts with a dot", ->
|
||||
expect(atom.packages.loadPackage("/Users/user/.atom/packages/.git")).toBeNull()
|
||||
|
||||
it "normalizes short repository urls in package.json", ->
|
||||
{metadata} = atom.packages.loadPackage("package-with-short-url-package-json")
|
||||
expect(metadata.repository.type).toBe "git"
|
||||
|
@ -367,6 +367,8 @@ class PackageManager
|
||||
@emitter.emit 'did-load-initial-packages'
|
||||
|
||||
loadPackage: (nameOrPath) ->
|
||||
return null if path.basename(nameOrPath)[0].match /^\./ # primarily to skip .git folder
|
||||
|
||||
return pack if pack = @getLoadedPackage(nameOrPath)
|
||||
|
||||
if packagePath = @resolvePackagePath(nameOrPath)
|
||||
|
Loading…
Reference in New Issue
Block a user