diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 22acfc4d..ab232802 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: regen-protobuf name: Regenerate protobuf files files: server/api/ - entry: bash generate.bash + entry: bash server/api/generate.bash language: system pass_filenames: false stages: [commit] diff --git a/server/api/installBuf.bash b/server/api/installBuf.bash index e6be4984..4c0712bc 100755 --- a/server/api/installBuf.bash +++ b/server/api/installBuf.bash @@ -1,9 +1,17 @@ #!/bin/bash +BASEDIR=$(dirname "$0") +echo making sure that this script is run from $BASEDIR +pushd $BASEDIR > /dev/null + +echo downloading... go get github.com/bufbuild/buf/cmd/buf \ + github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ + github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \ google.golang.org/protobuf/cmd/protoc-gen-go \ google.golang.org/grpc/cmd/protoc-gen-go-grpc +echo installing... go install \ github.com/bufbuild/buf/cmd/buf \ github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ @@ -11,4 +19,8 @@ go install \ google.golang.org/protobuf/cmd/protoc-gen-go \ google.golang.org/grpc/cmd/protoc-gen-go-grpc + +echo tidiing up go mod tidy + +popd