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