Commit 64ecc5ca authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

command/fix: use strings instead of Fixer for list

parent 3f1af409
...@@ -49,10 +49,18 @@ func (c Command) Run(env packer.Environment, args []string) int { ...@@ -49,10 +49,18 @@ func (c Command) Run(env packer.Environment, args []string) int {
tplF.Close() tplF.Close()
// Run the template through the various fixers // Run the template through the various fixers
fixers := []Fixer{Fixers["iso-md5"]} fixers := []string{
"iso-md5",
}
input := templateData input := templateData
for _, fixer := range fixers { for _, name := range fixers {
var err error var err error
fixer, ok := Fixers[name]
if !ok {
panic("fixer not found: " + name)
}
input, err = fixer.Fix(input) input, err = fixer.Fix(input)
if err != nil { if err != nil {
env.Ui().Error(fmt.Sprintf("Error fixing: %s", err)) env.Ui().Error(fmt.Sprintf("Error fixing: %s", 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