Commit 84f8c0bf authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

command/fix: cleaner

parent b6795081
...@@ -49,15 +49,8 @@ func (c Command) Run(env packer.Environment, args []string) int { ...@@ -49,15 +49,8 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Close the file since we're done with that // Close the file since we're done with that
tplF.Close() tplF.Close()
// Run the template through the various fixers
fixers := []string{
"iso-md5",
"createtime",
"virtualbox-gaattach",
}
input := templateData input := templateData
for _, name := range fixers { for _, name := range FixerOrder {
var err error var err error
fixer, ok := Fixers[name] fixer, ok := Fixers[name]
if !ok { if !ok {
......
...@@ -15,10 +15,19 @@ type Fixer interface { ...@@ -15,10 +15,19 @@ type Fixer interface {
// Fixers is the map of all available fixers, by name. // Fixers is the map of all available fixers, by name.
var Fixers map[string]Fixer var Fixers map[string]Fixer
// FixerOrder is the default order the fixers should be run.
var FixerOrder []string
func init() { func init() {
Fixers = map[string]Fixer{ Fixers = map[string]Fixer{
"iso-md5": new(FixerISOMD5), "iso-md5": new(FixerISOMD5),
"createtime": new(FixerCreateTime), "createtime": new(FixerCreateTime),
"virtualbox-gaattach": new(FixerVirtualBoxGAAttach), "virtualbox-gaattach": new(FixerVirtualBoxGAAttach),
} }
FixerOrder = []string{
"iso-md5",
"createtime",
"virtualbox-gaattach",
}
} }
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