command/fix: use strings instead of Fixer for list
This commit is contained in:
parent
23803621e9
commit
bdd49619ae
|
@ -49,10 +49,18 @@ func (c Command) Run(env packer.Environment, args []string) int {
|
|||
tplF.Close()
|
||||
|
||||
// Run the template through the various fixers
|
||||
fixers := []Fixer{Fixers["iso-md5"]}
|
||||
fixers := []string{
|
||||
"iso-md5",
|
||||
}
|
||||
|
||||
input := templateData
|
||||
for _, fixer := range fixers {
|
||||
for _, name := range fixers {
|
||||
var err error
|
||||
fixer, ok := Fixers[name]
|
||||
if !ok {
|
||||
panic("fixer not found: " + name)
|
||||
}
|
||||
|
||||
input, err = fixer.Fix(input)
|
||||
if err != nil {
|
||||
env.Ui().Error(fmt.Sprintf("Error fixing: %s", err))
|
||||
|
|
Loading…
Reference in New Issue