1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-26 03:52:12 +02:00
Felix Hao 1481e14c12
add protoc gen ecode (#274)
* add protoc gen ecode
* add protobuf example
2019-08-16 11:15:38 +08:00

26 lines
474 B
Go

package main
import (
"os/exec"
"github.com/urfave/cli"
)
const (
_getBMGen = "go get -u github.com/bilibili/kratos/tool/protobuf/protoc-gen-bm"
_bmProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --bm_out=:."
)
func installBMGen() error {
if _, err := exec.LookPath("protoc-gen-bm"); err != nil {
if err := goget(_getBMGen); err != nil {
return err
}
}
return nil
}
func genBM(ctx *cli.Context) error {
return generate(ctx, _bmProtoc)
}