Migrate to Hardhat (#2397)
This commit is contained in:
committed by
GitHub
parent
0c27ecc536
commit
f06738828b
@ -23,20 +23,19 @@ const ignorePatternsSubtrees = ignorePatterns
|
||||
.concat(ignorePatterns.map(pat => path.join(pat, '**/*')))
|
||||
.map(p => p.replace(/^\//, ''));
|
||||
|
||||
const solcOutput = readJSON('cache/solc-output.json');
|
||||
|
||||
const artifactsDir = 'build/contracts';
|
||||
|
||||
let n = 0;
|
||||
|
||||
for (const artifact of fs.readdirSync(artifactsDir)) {
|
||||
const fullArtifactPath = path.join(artifactsDir, artifact);
|
||||
const { sourcePath: fullSourcePath } = readJSON(fullArtifactPath);
|
||||
const sourcePath = path.relative('.', fullSourcePath);
|
||||
|
||||
for (const sourcePath in solcOutput.contracts) {
|
||||
const ignore = match.any(sourcePath, ignorePatternsSubtrees);
|
||||
|
||||
if (ignore) {
|
||||
fs.unlinkSync(fullArtifactPath);
|
||||
n += 1;
|
||||
for (const contract in solcOutput.contracts[sourcePath]) {
|
||||
fs.unlinkSync(path.join(artifactsDir, contract + '.json'));
|
||||
n += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user