-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update how Mockery mocks are checked for currency.
The use of "go install" is deprecated as a way of installing and running the Mockery binary. Update the runner script to depend on an ambient version of the tool and ensure that in CI it's installed.
- Loading branch information
M. J. Fromberger
committed
Jun 3, 2022
1 parent
75a12ea
commit 9418c76
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
#!/bin/sh | ||
# | ||
# Invoke Mockery v2 to update generated mocks for the given type. | ||
# | ||
# This script runs a locall-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 | ||
|
||
go run github.com/vektra/mockery/v2 --disable-version-string --case underscore --name $* | ||
mockery --disable-version-string --case underscore --name "$@" |