tools: manage mockery version using tools.go pattern

This commit is contained in:
William Banfield
2022-08-09 10:23:54 -04:00
parent 10e1ac8fea
commit 20dd404afb
18 changed files with 37 additions and 45 deletions
+2 -11
View File
@@ -1,15 +1,6 @@
#!/bin/sh
#
# Invoke Mockery v2 to update generated mocks for the given type.
#
# This script runs a locally-installed "mockery" if available, otherwise it
# runs the published Docker container. This legerdemain is so that the CI build
# and a local build can work off the same script.
#
if ! which mockery ; then
mockery() {
docker run --rm -v "$PWD":/w --workdir=/w vektra/mockery:v2.12.3
}
fi
mockery --disable-version-string --case underscore --name "$@"
go run github.com/vektra/mockery/v2 --disable-version-string --case underscore --name "$*"