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