dsa-polygon-migration/scripts/flatten.sh

19 lines
429 B
Bash
Raw Permalink Normal View History

2021-04-14 23:00:37 +00:00
#!/bin/bash
baseContractPath='contracts'
function find() {
for file in "$1"/*; do
if [[ -d "$file" ]]; then
# echo "directory $file"
mkdir flatten/$file
find $file
elif [[ -f "$file" ]]; then
echo "Created [`basename "$file"`]"
npx hardhat flatten $file > flatten/$file
fi
done
}
rm -rf flatten/$baseContractPath
mkdir flatten/$baseContractPath
find $baseContractPath