diff options
| author | mo khan <mo@mokhan.ca> | 2025-03-06 10:18:52 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-03-06 10:18:52 -0700 |
| commit | 37565b67e9713c05f8df8fdedddfac5cc137238a (patch) | |
| tree | 0a68012a11d33c9c9373422014a62f573c866ca1 /magefile.go | |
| parent | e31ddc33417517fb754cbd7e13f8a13746bede02 (diff) | |
chore: compile each protobuf definition
Diffstat (limited to 'magefile.go')
| -rw-r--r-- | magefile.go | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/magefile.go b/magefile.go index 5e17799..4a1ce01 100644 --- a/magefile.go +++ b/magefile.go @@ -5,10 +5,12 @@ package main import ( "context" + "path/filepath" "runtime" "github.com/magefile/mage/mg" "github.com/magefile/mage/sh" + "github.com/xlgmokha/x/pkg/x" ) // Default target to run when none is specified @@ -76,13 +78,20 @@ func Browser() error { // Generate gRPC from protocal buffers func Protos() error { - return sh.RunV( - "grpc_tools_ruby_protoc", - "--proto_path=./protos", - "--ruby_out=lib", - "--grpc_out=lib", - "protos/ability.proto", - ) + files := x.Must(filepath.Glob("./protos/*.proto")) + for _, file := range files { + if err := sh.RunV( + "grpc_tools_ruby_protoc", + "--proto_path=./protos", + "--ruby_out=lib", + "--grpc_out=lib", + file, + ); err != nil { + return err + } + } + + return nil } // Run All the servers |
