mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-28 17:13:45 +03:00
Add versions to output
This commit is contained in:
parent
e0654d62e8
commit
c60e4345ed
@ -8,15 +8,16 @@ module.exports = (grunt) ->
|
||||
grunt.file.recurse nodeModulesDir, (absolutePath, rootPath, relativePath, fileName) ->
|
||||
return if fileName isnt 'package.json'
|
||||
|
||||
{name} = grunt.file.readJSON(absolutePath)
|
||||
modules[name] ?= 0
|
||||
modules[name]++
|
||||
{name, version} = grunt.file.readJSON(absolutePath)
|
||||
modules[name] ?= {versions: {}, count: 0}
|
||||
modules[name].count++
|
||||
modules[name].versions[version] = true
|
||||
|
||||
sortedNames = Object.keys(modules).sort (name1, name2) ->
|
||||
diff = modules[name2] - modules[name1]
|
||||
diff = modules[name2].count - modules[name1].count
|
||||
diff = name1.localeCompare(name2) if diff is 0
|
||||
diff
|
||||
|
||||
sortedNames.forEach (name) ->
|
||||
count = modules[name]
|
||||
grunt.log.error "#{name}: #{count}" if count > 1
|
||||
{count, versions} = modules[name]
|
||||
grunt.log.error "#{name}: #{count} (#{Object.keys(versions).join(', ')})" if count > 1
|
||||
|
Loading…
Reference in New Issue
Block a user