Commit 5dec2ddb authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

common: weakly decode the PackerConfig

parent ce7ea006
......@@ -191,8 +191,17 @@ func decodeConfigHook(raws []interface{}) (mapstructure.DecodeHookFunc, error) {
// First thing we do is decode PackerConfig so that we can have access
// to the user variables so that we can process some templates.
var pc PackerConfig
decoderConfig := &mapstructure.DecoderConfig{
Result: &pc,
WeaklyTypedInput: true,
}
decoder, err := mapstructure.NewDecoder(decoderConfig)
if err != nil {
return nil, err
}
for _, raw := range raws {
if err := mapstructure.Decode(raw, &pc); err != nil {
if err := decoder.Decode(raw); err != nil {
return nil, err
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment