mirror of
https://github.com/Instadapp/dsa-polygon-migration.git
synced 2024-07-29 22:27:58 +00:00
19 lines
429 B
Bash
19 lines
429 B
Bash
|
#!/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
|