mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-08-25 23:07:32 +00:00
update-go-mod updates itself too
Signed-off-by: Ryan Richard <richardry@vmware.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2023-2025 the Pinniped contributors. All Rights Reserved.
|
||||
# Copyright 2023-2026 the Pinniped contributors. All Rights Reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -euo pipefail
|
||||
@@ -10,6 +10,8 @@ ROOT_DIR="$SCRIPT_DIR/../.."
|
||||
|
||||
GO_MOD="${ROOT_DIR}/go.mod"
|
||||
|
||||
echo "Updating $GO_MOD ..."
|
||||
|
||||
pushd "${SCRIPT_DIR}" >/dev/null
|
||||
script=$(go run . "${GO_MOD}" overrides.conf)
|
||||
popd >/dev/null
|
||||
@@ -21,6 +23,14 @@ pushd "${ROOT_DIR}" >/dev/null
|
||||
eval "$script"
|
||||
popd >/dev/null
|
||||
|
||||
# Next update the go.mod of update-go-mod itself.
|
||||
echo "Updating $SCRIPT_DIR/go.mod ..."
|
||||
|
||||
pushd "${SCRIPT_DIR}" >/dev/null
|
||||
go get "golang.org/x/mod@latest"
|
||||
go mod tidy
|
||||
popd >/dev/null
|
||||
|
||||
# This script assumes that you are using the latest version of Go so it can detect its
|
||||
# version and update all the go.mod files to use that version.
|
||||
go_version="$(go version | cut -d ' ' -f3 | sed 's/^go//')"
|
||||
|
||||
Reference in New Issue
Block a user