Update remappings.txt for upgradeable contracts and set up submodule (#4639)

Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Ernesto García <ernestognw@gmail.com>
This commit is contained in:
Francisco
2023-10-02 15:41:18 -03:00
committed by GitHub
parent 5ed5a86d1d
commit abba0d047a
16 changed files with 78 additions and 34 deletions

View File

@ -15,7 +15,7 @@ base="${2-}"
bash scripts/upgradeable/transpile.sh
commit="$(git rev-parse --short HEAD)"
branch="$(git rev-parse --abbrev-ref HEAD)"
start_branch="$(git rev-parse --abbrev-ref HEAD)"
git add contracts
@ -36,9 +36,19 @@ else
fi
fi
# commit if there are changes to commit
if ! git diff --quiet --cached; then
git commit -m "Transpile $commit"
# abort if there are no changes to commit at this point
if git diff --quiet --cached; then
exit
fi
git checkout "$branch"
if [[ -v SUBMODULE_REMOTE ]]; then
lib=lib/openzeppelin-contracts
git submodule add -b "${base#origin/}" "$SUBMODULE_REMOTE" "$lib"
git -C "$lib" checkout "$commit"
git add "$lib"
fi
git commit -m "Transpile $commit"
# return to original branch
git checkout "$start_branch"