dsa-polygon-migration/scripts/flatten.sh
2021-04-15 04:30:37 +05:30

19 lines
429 B
Bash
Executable File

#!/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