mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
update
This commit is contained in:
@@ -20,8 +20,10 @@ describe "Package", ->
|
||||
expect(pack.incompatibleModules[0].path).toBe path.join(packagePath, 'node_modules', 'native-module')
|
||||
|
||||
it "utilizes _atomModuleCache to get native modules and skips traversing through submodules", ->
|
||||
packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-both-incompatible-and-compatible-native-modules')
|
||||
packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-ignored-incompatible-native-module')
|
||||
pack = new Package(packagePath)
|
||||
# Since `_atomModuleCache` exists and it doesn't have the record of the
|
||||
# incompatible native module, this package is recognized as compatible.
|
||||
expect(pack.isCompatible()).toBe true
|
||||
|
||||
it "caches the incompatible native modules in local storage", ->
|
||||
|
||||
@@ -598,10 +598,10 @@ class Package
|
||||
nativeModulePaths = []
|
||||
|
||||
if @metadata._atomModuleCache?
|
||||
nativeModuleBindingPaths = @metadata._atomModuleCache.extensions?['.node'] ?[]
|
||||
nativeModuleBindingPaths = @metadata._atomModuleCache.extensions?['.node'] ? []
|
||||
for nativeModuleBindingPath in nativeModuleBindingPaths
|
||||
# The `.node` file lies in nativeModulePath/build/Release/ folder.
|
||||
nativeModulePath = path.normalize(path.join(path.dirname(nativeModuleBindingPath), '..', '..'))
|
||||
nativeModulePath = path.join(path.dirname(nativeModuleBindingPath), '..', '..')
|
||||
nativeModulePaths.push(nativeModulePath) if @isNativeModule(nativeModulePath)
|
||||
return nativeModulePaths
|
||||
|
||||
|
||||
Reference in New Issue
Block a user