We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could we support this simple task?
I am doing it with the following, but would be great if it could be supported as a default task
task('flatten:all', 'Flatten all contracts each file under flatten directory') .setAction(async (taskArgs, hre) => { const allFilesAndFolders = fs.readdirSync('contracts', { recursive: true }) as Array<string>; const allFolders = allFilesAndFolders.filter(f => fs.statSync(path.join('contracts', f)).isDirectory()); const allFiles = allFilesAndFolders.filter(f => !allFolders.includes(f)); fs.rmSync('flatten', { force: true, recursive: true }); fs.mkdirSync('flatten'); allFolders.forEach(f => { fs.mkdirSync(path.join('flatten', f), { recursive: true }); }); await Promise.all(allFiles.map(async (f) => { const contract = path.join('contracts', f); const contractTo = path.join('flatten', f); try { const flatten = await hre.run('flatten:get-flattened-sources', { files: [contract] }); fs.writeFileSync(contractTo, flatten); console.log(`Wrote ${contractTo} contract`); } catch (e) { // Catching circular contracts console.log(`Failed to write ${contractTo} contract`); console.log(e); } })); });
No response
The text was updated successfully, but these errors were encountered:
kanej
No branches or pull requests
Describe the feature
Could we support this simple task?
I am doing it with the following, but would be great if it could be supported as a default task
Search terms
No response
The text was updated successfully, but these errors were encountered: