@solidstate/hardhat-license-identifier
Version:
Prepend local Solidity source files with an SPDX License Identifier
11 lines (10 loc) • 611 B
JavaScript
import { filterSourcePaths, readLicenseFromPackageJson, readSourceLicenses, } from '../lib/license_identifier.js';
import { printSourceLicenses } from '../lib/print.js';
const action = async (args, hre) => {
const config = hre.config.licenseIdentifier;
const sourcePaths = filterSourcePaths(config, await hre.solidity.getRootFilePaths());
const packageJsonLicense = await readLicenseFromPackageJson(hre.config.paths.root);
const sourceLicenses = await readSourceLicenses(sourcePaths, hre.config.paths.root);
printSourceLicenses(packageJsonLicense, sourceLicenses);
};
export default action;