Add script for updating go.mod to use local plugeth-statediff #3

Merged
roysc merged 5 commits from telackey/ci into main 2023-09-27 07:48:33 +00:00
Showing only changes of commit 43a2245b65 - Show all commits

View File

@ -11,6 +11,7 @@ fi
CURRENT_REPLACEMENTS=$(go mod edit --json | jq -r '.Replace[] | "\(.Old.Path) \(.New.Path)"')
echo "github.com/cerc-io/plugeth-statediff=${PLUGETH_STATEDIFF_DIR}"
go mod edit --replace "github.com/cerc-io/plugeth-statediff=${PLUGETH_STATEDIFF_DIR}"
for r in `go mod edit --json ${PLUGETH_STATEDIFF_DIR}/go.mod | jq -r '.Replace[] | "\(.Old.Path)=\(.New.Path)@\(.New.Version)"'`; do
orig=$(echo $r | cut -d'=' -f1)
@ -19,6 +20,7 @@ for r in `go mod edit --json ${PLUGETH_STATEDIFF_DIR}/go.mod | jq -r '.Replace[]
if [ $? -ne 0 ]; then
continue;
fi
echo "$r"
go mod edit --replace "$r"
done