Skip to content

Commit

Permalink
support registry v0.4.0-wip.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aatarasoff committed Dec 5, 2023
1 parent 085407d commit e0c2acd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
9 changes: 8 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,15 @@ func NewGetModuleCmd(config *model.Config, client v1.RegistryClient) *cobra.Comm
Use: "get [module_name]",
Short: "Get",
Long: "Get is a command to get modules",
Args: cobra.ExactArgs(1),
Args: cobra.RangeArgs(0, 1),
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 0 {
if config.Name == "" {
log.Fatalf("module name is required. see pbuf.yaml reference")
}
args = append(args, config.Name)
}

moduleName := args[0]

module, err := client.GetModule(cmd.Context(), &v1.GetModuleRequest{
Expand Down
37 changes: 24 additions & 13 deletions gen/pbuf-registry/v1/entities.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pbuf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ registry:
modules:
- name: pbufio/pbuf-registry
path: api/pbuf-registry
tag: v0.4.0-wip.1
tag: v0.4.0-wip.2
out: third_party/pbuf-registry
gen_out: gen/pbuf-registry
- name: googleapis
Expand Down
3 changes: 3 additions & 0 deletions third_party/pbuf-registry/v1/entities.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ message Module {

// The draft tags of the module.
repeated string draft_tags = 4;

// Packages that uses in this module
repeated string packages = 5;
}

// ProtoFile is a proto file registered in the registry.
Expand Down

0 comments on commit e0c2acd

Please sign in to comment.