2013-12-27 08:37:39 -07:00
|
|
|
package common
|
|
|
|
|
|
|
|
import (
|
2014-10-28 08:37:12 -07:00
|
|
|
"os"
|
2013-12-27 08:37:39 -07:00
|
|
|
|
2017-04-04 13:39:01 -07:00
|
|
|
"github.com/hashicorp/packer/template/interpolate"
|
2013-12-27 08:37:39 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
type DriverConfig struct {
|
|
|
|
FusionAppPath string `mapstructure:"fusion_app_path"`
|
|
|
|
}
|
|
|
|
|
2015-05-27 14:16:28 -07:00
|
|
|
func (c *DriverConfig) Prepare(ctx *interpolate.Context) []error {
|
2014-10-28 08:21:39 -07:00
|
|
|
if c.FusionAppPath == "" {
|
|
|
|
c.FusionAppPath = os.Getenv("FUSION_APP_PATH")
|
|
|
|
}
|
2013-12-27 08:37:39 -07:00
|
|
|
if c.FusionAppPath == "" {
|
|
|
|
c.FusionAppPath = "/Applications/VMware Fusion.app"
|
|
|
|
}
|
|
|
|
|
2015-05-27 14:16:28 -07:00
|
|
|
return nil
|
2013-12-27 08:37:39 -07:00
|
|
|
}
|