Cache incompatible modules in local storage

This commit is contained in:
Kevin Sawicki
2014-07-25 15:34:03 -07:00
parent 56df7bdbe3
commit d47348e8f9
2 changed files with 24 additions and 1 deletions

View File

@@ -362,8 +362,11 @@ class Package
nativeModulePaths
getIncompatibleNativeModules: ->
incompatibleNativeModules = []
localStorageKey = "installed-packages:#{@name}:#{@metadata.version}"
{incompatibleNativeModules} = global.localStorage.getItem(localStorageKey) ? {}
return incompatibleNativeModules if incompatibleNativeModules?
incompatibleNativeModules = []
for nativeModulePath in @getNativeModuleDependencyPaths()
try
require(nativeModulePath)
@@ -373,6 +376,7 @@ class Package
name: path.basename(nativeModulePath)
error: error
global.localStorage.setItem(localStorageKey, {incompatibleNativeModules})
incompatibleNativeModules
# Public: Is this package compatible with this version of Atom?