chore: allows dumping rendered templates using EVCC_TEMPLATE_RENDER=<template>
This commit is contained in:
parent
d4ecb4b2db
commit
bfa9901cb8
1 changed files with 5 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ package templates
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/evcc-io/evcc/util"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
|
@ -35,6 +36,10 @@ func RenderInstance(class Class, other map[string]interface{}) (*Instance, error
|
|||
return nil, util.NewConfigError(err)
|
||||
}
|
||||
|
||||
if os.Getenv("EVCC_TEMPLATE_RENDER") == cc.Template {
|
||||
fmt.Println(string(b))
|
||||
}
|
||||
|
||||
var instance Instance
|
||||
if err := yaml.Unmarshal(b, &instance); err != nil {
|
||||
return nil, fmt.Errorf("%w:\n%s", err, string(b))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue