From fa9e85a9773b6707f2d0aab53aa62719c1a26c05 Mon Sep 17 00:00:00 2001 From: "Matt, Park" <45252226+mattverse@users.noreply.github.com> Date: Thu, 13 Jul 2023 21:03:58 +0900 Subject: [PATCH] Add Make Command to Update SDK Dependency (#5830) * Finish :) * Edit doc --- Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Makefile b/Makefile index 2aa2f3980a7..3671deb1641 100644 --- a/Makefile +++ b/Makefile @@ -187,6 +187,32 @@ clean: distclean: clean rm -rf vendor/ +############################################################################### +### Dependency Updates ### +############################################################################### + +VERSION := +MODFILES := ./go.mod ./osmoutils/go.mod ./osmomath/go.mod ./x/epochs/go.mod ./x/ibc-hooks/go.mod ./tests/cl-genesis-positions/go.mod ./tests/cl-go-client/go.mod +# run with VERSION argument specified +# e.g) make update-sdk-version VERSION=v0.45.1-0.20230523200430-193959b898ec +# This will change sdk dependencyu version for go.mod in root directory + all sub-modules in this repo. +update-sdk-version: + @if [ -z "$(VERSION)" ]; then \ + echo "VERSION not set"; \ + exit 1; \ + fi + @echo "Updating version to $(VERSION)" + @for modfile in $(MODFILES); do \ + if [ -e "$$modfile" ]; then \ + sed -i '' 's|github.com/osmosis-labs/cosmos-sdk v[0-9a-z.\-]*|github.com/osmosis-labs/cosmos-sdk $(VERSION)|g' $$modfile; \ + cd `dirname $$modfile`; \ + go mod tidy; \ + cd - > /dev/null; \ + else \ + echo "File $$modfile does not exist"; \ + fi; \ + done + ############################################################################### ### Proto ### ###############################################################################