mirror of
https://github.com/elastic/kibana.git
synced 2025-04-20 07:48:52 -04:00
29 lines
723 B
JavaScript
29 lines
723 B
JavaScript
import { getInstalledPackages } from '../src/dev/npm';
|
|
import {
|
|
assertLicensesValid,
|
|
LICENSE_WHITELIST,
|
|
LICENSE_OVERRIDES,
|
|
} from '../src/dev/license_checker';
|
|
|
|
export default function licenses(grunt) {
|
|
grunt.registerTask('licenses', 'Checks dependency licenses', async function () {
|
|
const done = this.async();
|
|
|
|
try {
|
|
const dev = Boolean(grunt.option('dev'));
|
|
|
|
assertLicensesValid({
|
|
packages: await getInstalledPackages({
|
|
directory: grunt.config.get('root'),
|
|
licenseOverrides: LICENSE_OVERRIDES,
|
|
dev
|
|
}),
|
|
validLicenses: LICENSE_WHITELIST
|
|
});
|
|
done();
|
|
} catch (err) {
|
|
grunt.fail.fatal(err);
|
|
done(err);
|
|
}
|
|
});
|
|
}
|