fix(core): update

This commit is contained in:
2024-06-23 13:26:51 +02:00
parent 6140b2b25b
commit 20d34b998e
8 changed files with 437 additions and 215 deletions

View File

@@ -11,6 +11,11 @@ const incompatibleLicenses: string[] = [
];
export const run = async (projectArg: Project) => {
const nodeModulesInstalled = await plugins.smartfile.fs.isDirectory(plugins.path.join(paths.cwd, 'node_modules'));
if (!nodeModulesInstalled) {
logger.log('warn', 'No node_modules found. Skipping license check');
return;
}
const licenseChecker = await plugins.smartlegal.createLicenseChecker();
const licenseCheckResult = await licenseChecker.excludeLicenseWithinPath(paths.cwd, incompatibleLicenses);
if (licenseCheckResult.failingModules.length === 0) {