2017-02-13 19:01:54 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-11-14 21:54:35 +00:00
|
|
|
#
|
|
|
|
# This file is just a wrapper around the 'go mod vendor' tool.
|
2021-12-15 19:35:04 +00:00
|
|
|
# For updating dependencies you should change `vendor.mod` file in root of the
|
|
|
|
# project.
|
2016-04-19 13:35:06 +00:00
|
|
|
|
2016-10-31 18:22:28 +00:00
|
|
|
set -e
|
2013-12-19 17:01:55 +00:00
|
|
|
|
2021-12-15 19:35:04 +00:00
|
|
|
SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
2022-11-14 21:54:35 +00:00
|
|
|
|
|
|
|
tidy() (
|
|
|
|
set -x
|
2022-11-18 15:29:06 +00:00
|
|
|
"${SCRIPTDIR}"/with-go-mod.sh go mod tidy -modfile vendor.mod -compat 1.18
|
2022-11-14 21:54:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
vendor() (
|
|
|
|
set -x
|
2022-11-18 15:29:06 +00:00
|
|
|
"${SCRIPTDIR}"/with-go-mod.sh go mod vendor -modfile vendor.mod
|
2022-11-14 21:54:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
help() {
|
|
|
|
printf "%s:\n" "$(basename "$0")"
|
|
|
|
echo " - tidy: run go mod tidy"
|
|
|
|
echo " - vendor: run go mod vendor"
|
|
|
|
echo " - all: run tidy && vendor"
|
|
|
|
echo " - help: show this help"
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
tidy) tidy ;;
|
|
|
|
vendor) vendor ;;
|
|
|
|
""|all) tidy && vendor ;;
|
|
|
|
*) help ;;
|
|
|
|
esac
|