(cs config.CombinedSettings, s config.Codegen)
| 20 | } |
| 21 | |
| 22 | func pluginCodegen(cs config.CombinedSettings, s config.Codegen) *plugin.Codegen { |
| 23 | opts, err := convert.YAMLtoJSON(s.Options) |
| 24 | if err != nil { |
| 25 | panic(err) |
| 26 | } |
| 27 | cg := &plugin.Codegen{ |
| 28 | Out: s.Out, |
| 29 | Plugin: s.Plugin, |
| 30 | Options: opts, |
| 31 | } |
| 32 | for _, p := range cs.Global.Plugins { |
| 33 | if p.Name == s.Plugin { |
| 34 | cg.Env = p.Env |
| 35 | cg.Process = pluginProcess(p) |
| 36 | cg.Wasm = pluginWASM(p) |
| 37 | return cg |
| 38 | } |
| 39 | } |
| 40 | return cg |
| 41 | } |
| 42 | |
| 43 | func pluginProcess(p config.Plugin) *plugin.Codegen_Process { |
| 44 | if p.Process != nil { |
no test coverage detected