github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/helper/compile/custom_vagrant.go (about) 1 package compile 2 3 import ( 4 "github.com/hashicorp/otto/helper/schema" 5 ) 6 7 // VagrantCustomizations returns common Vagrant customizations that work 8 // with the default settings of the app compilation helper. 9 func VagrantCustomizations(opts *AppOptions) *Customization { 10 return &Customization{ 11 Callback: vagrantCustomizationCallback(opts), 12 Schema: map[string]*schema.FieldSchema{ 13 "vagrantfile": &schema.FieldSchema{ 14 Type: schema.TypeString, 15 Description: "Vagrantfile contents to append for development.", 16 }, 17 }, 18 } 19 } 20 21 func vagrantCustomizationCallback(opts *AppOptions) CustomizationFunc { 22 return func(d *schema.FieldData) error { 23 opts.Bindata.Context["dev_extra_vagrantfile"] = d.Get("vagrantfile") 24 return nil 25 } 26 }