Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
xorcare committed Sep 21, 2024
1 parent 8a6fd0f commit 381d5d7
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions go-mod-bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,28 +110,4 @@ function update_module() {
go build ./...
}

function bump_module() {
module=$(echo "$1" | cut -f1 -d@)
current_version=$(echo "$1" | cut -f2 -d@)
latest_version=$(echo "$1" | cut -f3 -d@)

if ! update_module "${module}@${latest_version}" >/dev/null 2>&1 >/dev/null; then
echoerr "go-mod-bump: failed to update module ${module} from ${current_version} to ${latest_version}"
echoerr "try to update module manually using commands:"
echoerr "go get ${module}@${latest_version}"
echoerr "go mod tidy"
echoerr "go build ./..."
git checkout -f HEAD -- go.mod go.sum
return
fi

git reset HEAD -- . >/dev/null
git add go.mod go.sum >/dev/null
git commit -a -m "${PREFIX}Bump ${module} from ${current_version} to ${latest_version}" >/dev/null

echoerr "go-mod-bump: upgraded ${module} ${current_version} => [${latest_version}]"
}

for mdl in $MODULES_FOR_UPDATE; do
(bump_module "$mdl")
done
echo "DO NOTHING"

0 comments on commit 381d5d7

Please sign in to comment.