packer-cn/builder/parallels/common/prlctl_version_config.go

27 lines
819 B
Go
Raw Normal View History

//go:generate struct-markdown
package common
import (
2017-04-04 16:39:01 -04:00
"github.com/hashicorp/packer/template/interpolate"
)
// PrlctlVersionConfig contains the configuration for `prlctl` version.
type PrlctlVersionConfig struct {
// The path within the virtual machine to
2019-06-06 10:29:25 -04:00
// upload a file that contains the prlctl version that was used to create
// the machine. This information can be useful for provisioning. By default
// this is ".prlctl_version", which will generally upload it into the
// home directory.
PrlctlVersionFile string `mapstructure:"prlctl_version_file" required:"false"`
}
// Prepare sets the default value of "PrlctlVersionFile" property.
func (c *PrlctlVersionConfig) Prepare(ctx *interpolate.Context) []error {
if c.PrlctlVersionFile == "" {
c.PrlctlVersionFile = ".prlctl_version"
}
return nil
}