Comparar commits
3 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 6e8e4a56cf | |||
| e53c38f09d | |||
| 587b73e3b9 |
@@ -228,7 +228,7 @@ class PackageManager
|
||||
packages = []
|
||||
for packagePath in @getAvailablePackagePaths()
|
||||
name = path.basename(packagePath)
|
||||
metadata = @getLoadedPackage(name)?.metadata ? Package.loadMetadata(packagePath, true)
|
||||
metadata = @getLoadedPackage(name)?.metadata ? Package.loadMetadata(packagePath, {ignoreErrors: true, @resourcePath, @devMode})
|
||||
packages.push(metadata)
|
||||
packages
|
||||
|
||||
@@ -252,7 +252,7 @@ class PackageManager
|
||||
@packageDependencies
|
||||
|
||||
hasAtomEngine: (packagePath) ->
|
||||
metadata = Package.loadMetadata(packagePath, true)
|
||||
metadata = Package.loadMetadata(packagePath, ignoreErrors: true)
|
||||
metadata?.engines?.atom?
|
||||
|
||||
unobserveDisabledPackages: ->
|
||||
|
||||
+10
-7
@@ -26,16 +26,19 @@ class Package
|
||||
|
||||
@stylesheetsDir: 'stylesheets'
|
||||
|
||||
@isBundledPackagePath: (packagePath) ->
|
||||
if atom.packages.devMode
|
||||
return false unless atom.packages.resourcePath.startsWith("#{process.resourcesPath}#{path.sep}")
|
||||
@isBundledPackagePath: (packagePath, resourcePath, devMode) ->
|
||||
resourcePath ?= atom?.packages.resourcePath
|
||||
devMode ?= atom?.packages.devMode
|
||||
|
||||
@resourcePathWithTrailingSlash ?= "#{atom.packages.resourcePath}#{path.sep}"
|
||||
packagePath?.startsWith(@resourcePathWithTrailingSlash)
|
||||
if devMode
|
||||
return false unless resourcePath.indexOf("#{process.resourcesPath}#{path.sep}") is 0
|
||||
|
||||
@loadMetadata: (packagePath, ignoreErrors=false) ->
|
||||
@resourcePathWithTrailingSlash ?= "#{resourcePath}#{path.sep}"
|
||||
packagePath?.indexOf(@resourcePathWithTrailingSlash) is 0
|
||||
|
||||
@loadMetadata: (packagePath, {ignoreErrors, devMode, resourcePath}={}) ->
|
||||
packageName = path.basename(packagePath)
|
||||
if @isBundledPackagePath(packagePath)
|
||||
if @isBundledPackagePath(packagePath, resourcePath, devMode)
|
||||
metadata = packagesCache[packageName]?.metadata
|
||||
unless metadata?
|
||||
if metadataPath = CSON.resolve(path.join(packagePath, 'package'))
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário