packer-cn/builder/vmware/common/output_config.go

21 lines
403 B
Go
Raw Normal View History

2013-12-25 16:01:57 -07:00
package common
import (
"fmt"
2015-05-27 14:16:28 -07:00
2017-04-04 13:39:01 -07:00
"github.com/hashicorp/packer/common"
"github.com/hashicorp/packer/template/interpolate"
2013-12-25 16:01:57 -07:00
)
type OutputConfig struct {
OutputDir string `mapstructure:"output_directory"`
}
2015-05-27 14:16:28 -07:00
func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error {
2013-12-25 16:01:57 -07:00
if c.OutputDir == "" {
c.OutputDir = fmt.Sprintf("output-%s", pc.PackerBuildName)
}
return nil
2013-12-25 16:01:57 -07:00
}