You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
501 B
26 lines
501 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"os/exec"
|
||
|
|
||
|
"github.com/urfave/cli"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
_getEcodeGen = "go get -u github.com/bilibili/kratos/tool/protobuf/protoc-gen-ecode"
|
||
|
_ecodeProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --ecode_out=:."
|
||
|
)
|
||
|
|
||
|
func installEcodeGen() error {
|
||
|
if _, err := exec.LookPath("protoc-gen-ecode"); err != nil {
|
||
|
if err := goget(_getEcodeGen); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func genEcode(ctx *cli.Context) error {
|
||
|
return generate(ctx, _ecodeProtoc)
|
||
|
}
|