Replace report-licenses with generate-license task. Output plain text.

This commit is contained in:
Nathan Sobo 2014-02-21 11:53:32 -07:00
parent c1cf4efb31
commit 324ae3fe3a

View File

@ -1,6 +1,6 @@
module.exports = (grunt) ->
grunt.registerTask 'report-licenses', 'Report the licenses of all dependencies', ->
grunt.registerTask 'generate-license', 'Generate the license, including the licenses of all dependencies', ->
legalEagle = require 'legal-eagle'
done = @async()
@ -21,12 +21,13 @@ getSummaryText = (summary) ->
names = keys(summary).sort()
for name in names
{license, source, sourceText} = summary[name]
text += "## #{name}\n\n"
text += "* License: #{license}\n"
text += "* License Source: #{source}\n" if source?
text += "-------------------------------------------------------------------------\n\n"
text += "Package: #{name}\n"
text += "License: #{license}\n"
text += "License Source: #{source}\n" if source?
if sourceText?
text += "* Source Text:\n"
for line in sourceText.split('\n')
text += "> #{line}\n"
text += "Source Text:\n\n"
text += sourceText
text += '\n'
text