#!/usr/bin/env node
/*eslint no-console: 0*/

'use strict';

const checker = require('license-checker');

const INCOMPATIBLE_LICENCE_REGEX = /GPL/;

checker.init({
  start: '.'
}, function(json, err) {
  if (err) {
    console.error(err.message);
    process.exit(1);
  } else {
    const incompatibleDependencies = Object.keys(json).filter((packageName) => {
      let licenses = json[packageName].licenses;

      if (!Array.isArray(licenses))
        licenses = [licenses];

      if (licenses.find((license) => license.match(INCOMPATIBLE_LICENCE_REGEX)))
        return packageName;
    });

    if (incompatibleDependencies.length > 0) {
      console.error('Found packages with incompatible license: ' + JSON.stringify(incompatibleDependencies));
      process.exit(1);
    }
  }
});

@@ -769,16 +769,112 @@
 xit(1);%0A
+    %7D else %7B%0A      console.log('All is well! No packages with an incompatible license found.');%0A
     %7D%0A  

Print calming message on check-licenses.js succees