mirror of https://github.com/docker/cli.git
scripts/vendor: run go mod tidy when vendoring
There was some debate about this, and wether or not tidy should be run when vendoring, but without this, validation failed after running `make vendor`, and manually doing a `go mod tidy` is complicated (due to the `vendor.mod`, and because the cache is not inside the build-cache, not on the host). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2b0e74c207
commit
5c4a395c52
|
@ -21,11 +21,10 @@ go 1.16
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
(set -x ; go mod vendor -modfile=vendor.mod)
|
(set -x ; go mod tidy -modfile=vendor.mod; go mod vendor -modfile=vendor.mod)
|
||||||
}
|
}
|
||||||
|
|
||||||
validate() {
|
validate() {
|
||||||
(set -x ; go mod tidy -modfile=vendor.mod)
|
|
||||||
diff=$(git status --porcelain -- vendor.mod vendor.sum vendor)
|
diff=$(git status --porcelain -- vendor.mod vendor.sum vendor)
|
||||||
if [ -n "$diff" ]; then
|
if [ -n "$diff" ]; then
|
||||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "make -f docker.Makefile vendor"'
|
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "make -f docker.Makefile vendor"'
|
||||||
|
|
Loading…
Reference in New Issue