From 37565b67e9713c05f8df8fdedddfac5cc137238a Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 6 Mar 2025 10:18:52 -0700 Subject: chore: compile each protobuf definition --- magefile.go | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'magefile.go') 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 -- cgit v1.2.3