Modify parsing functions and config structs to accept hcl changes

Signed-off-by: Patrick Van Stee <patrick@vanstee.me>
This commit is contained in:
Patrick Van Stee
2020-04-15 21:00:18 -04:00
parent 87c4bf1df9
commit 4121ae50b5
131 changed files with 45185 additions and 110 deletions

View File

@ -1,10 +1,10 @@
package bake
import "github.com/hashicorp/hcl"
import "github.com/hashicorp/hcl/v2/hclsimple"
func ParseHCL(dt []byte) (*Config, error) {
func ParseHCL(dt []byte, fn string) (*Config, error) {
var c Config
if err := hcl.Unmarshal(dt, &c); err != nil {
if err := hclsimple.Decode(fn, dt, nil, &c); err != nil {
return nil, err
}
return &c, nil