github.phpd.cn/hashicorp/packer@v1.3.2/builder/hyperv/common/output_config.go (about) 1 package common 2 3 import ( 4 "fmt" 5 6 "github.com/hashicorp/packer/common" 7 "github.com/hashicorp/packer/template/interpolate" 8 ) 9 10 type OutputConfig struct { 11 OutputDir string `mapstructure:"output_directory"` 12 } 13 14 func (c *OutputConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error { 15 if c.OutputDir == "" { 16 c.OutputDir = fmt.Sprintf("output-%s", pc.PackerBuildName) 17 } 18 19 return nil 20 }