mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-16 08:27:06 +08:00
Modify parsing functions and config structs to accept hcl changes
Signed-off-by: Patrick Van Stee <patrick@vanstee.me>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user