Skip to content

Commit

Permalink
webrpc-gen: Print custom targets properly
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Aug 5, 2023
1 parent bbb62bb commit ca6fbe4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func Generate(proto *schema.WebRPCSchema, target string, config *Config) (out *G
config.TemplateOptions,
}
if isLocalDir(target) {
vars.WebrpcTarget = "custom"
vars.WebrpcTarget = target
}

genOutput := &GenOutput{}
Expand All @@ -68,6 +68,8 @@ func Generate(proto *schema.WebRPCSchema, target string, config *Config) (out *G
if err != nil {
return genOutput, err
}
genOutput.TmplVersion = target
genOutput.IsLocal = true
genOutput.Code = genJSON
return genOutput, nil

Expand All @@ -77,6 +79,8 @@ func Generate(proto *schema.WebRPCSchema, target string, config *Config) (out *G
debug.DisablePointerAddresses = true
debug.Indent = "\t"
debug.SortKeys = true
genOutput.TmplVersion = target
genOutput.IsLocal = true
genOutput.Code = debug.Sdump(vars)
return genOutput, nil
}
Expand Down

0 comments on commit ca6fbe4

Please sign in to comment.