fix(core): update
This commit is contained in:
24
ts/mod_format/format.license.ts
Normal file
24
ts/mod_format/format.license.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import * as plugins from './mod.plugins.js';
|
||||
import * as paths from '../paths.js';
|
||||
import { Project } from '../classes.project.js';
|
||||
|
||||
import { logger } from '../gitzone.logging.js';
|
||||
|
||||
const incompatibleLicenses: string[] = [
|
||||
"AGPL",
|
||||
"GPL",
|
||||
"SSPL",
|
||||
];
|
||||
|
||||
export const run = async (projectArg: Project) => {
|
||||
const licenseChecker = await plugins.smartlegal.createLicenseChecker();
|
||||
const licenseCheckResult = await licenseChecker.excludeLicenseWithinPath(paths.cwd, incompatibleLicenses);
|
||||
if (licenseCheckResult.failingModules.length === 0) {
|
||||
logger.log('info', 'Success -> licenses passed!');
|
||||
} else {
|
||||
logger.log('error', 'Error -> licenses failed. Here is why:');
|
||||
for (const failedModule of licenseCheckResult.failingModules) {
|
||||
console.log(`${failedModule.name} fails with license ${failedModule.license}`);
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user