mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-06 08:08:10 +08:00
28 lines
852 B
CoffeeScript
28 lines
852 B
CoffeeScript
|
module.exports = (grunt) ->
|
||
|
grunt.registerTask 'check-licenses', 'Report the licenses of all dependencies', ->
|
||
|
legalEagle = require 'legal-eagle'
|
||
|
{size, keys} = require 'underscore-plus'
|
||
|
done = @async()
|
||
|
|
||
|
options =
|
||
|
path: process.cwd()
|
||
|
omitPermissive: true
|
||
|
overrides: require './license-overrides'
|
||
|
|
||
|
legalEagle options, (err, summary) ->
|
||
|
if err?
|
||
|
console.error(err)
|
||
|
process.exit 1
|
||
|
|
||
|
for key of summary
|
||
|
delete summary[key] if key.match /^atom@/
|
||
|
|
||
|
if size(summary)
|
||
|
console.error "Found dependencies without permissive licenses:"
|
||
|
for name in keys(summary).sort()
|
||
|
console.error "#{name}"
|
||
|
console.error " License: #{summary[name].license}"
|
||
|
console.error " Repository: #{summary[name].repository}"
|
||
|
process.exit 1
|
||
|
done()
|