scripts/with-go-mod.sh: use symlink instead of -modfile

While the "-modfile=vendor.mod" is slightly more correct, using a
symlink allows for most of the go tools to work "as usual", just
without an acual `go.mod` being committed in the repository.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-06-10 15:44:01 +02:00
parent b680c49f57
commit c17c247ed4
5 changed files with 31 additions and 21 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ if ! command -v "$GO_MD2MAN" > /dev/null; then
(
set -x
# note: this installs all tools defined in go.mod/vendor.mod
GOBIN="$(pwd)/build/tools" go install -mod=vendor -modfile=vendor.mod tool
GOBIN="$(pwd)/build/tools" go install -mod=vendor tool
)
GO_MD2MAN="$(pwd)/build/tools/go-md2man"
fi
@@ -16,7 +16,7 @@ fi
mkdir -p man/man1
(
set -x
go run -mod=vendor -modfile=vendor.mod -tags manpages ./man/generate.go --source "./man/src" --target "./man/man1"
go run -mod=vendor -tags manpages ./man/generate.go --source "./man/src" --target "./man/man1"
)
(