Inline path to listSync call

This commit is contained in:
Kevin Sawicki
2014-10-08 08:38:33 -07:00
committed by Kevin Sawicki
parent 26df31aa1f
commit 7b8a293f30

View File

@@ -11,8 +11,7 @@ cache =
ranges: {}
loadDependencies = (modulePath, rootPath, rootMetadata, moduleCache) ->
nodeModulesPath = path.join(modulePath, 'node_modules')
for childPath in fs.listSync(nodeModulesPath)
for childPath in fs.listSync(path.join(modulePath, 'node_modules'))
continue if path.basename(childPath) is '.bin'
continue if rootPath is modulePath and rootMetadata.packageDependencies?.hasOwnProperty(path.basename(childPath))
@@ -40,7 +39,6 @@ loadFolderCompatibility = (modulePath, rootPath, rootMetadata, moduleCache) ->
metadataPath = path.join(modulePath, 'package.json')
return unless fs.isFileSync(metadataPath)
nodeModulesPath = path.join(modulePath, 'node_modules')
dependencies = JSON.parse(fs.readFileSync(metadataPath))?.dependencies ? {}
for name, version of dependencies
@@ -65,7 +63,7 @@ loadFolderCompatibility = (modulePath, rootPath, rootMetadata, moduleCache) ->
if paths.length > 0 and Object.keys(dependencies).length > 0
moduleCache.folders.push({paths, dependencies})
for childPath in fs.listSync(nodeModulesPath)
for childPath in fs.listSync(path.join(modulePath, 'node_modules'))
continue if path.basename(childPath) is '.bin'
continue if rootPath is modulePath and rootMetadata.packageDependencies?.hasOwnProperty(path.basename(childPath))