github.com/tonnydourado/packer@v0.6.1-0.20140701134019-5d0cd9676a37/post-processor/vagrant/vmware.go (about) 1 package vagrant 2 3 import ( 4 "fmt" 5 "github.com/mitchellh/packer/packer" 6 "path/filepath" 7 ) 8 9 type VMwareProvider struct{} 10 11 func (p *VMwareProvider) KeepInputArtifact() bool { 12 return false 13 } 14 15 func (p *VMwareProvider) Process(ui packer.Ui, artifact packer.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { 16 // Create the metadata 17 metadata = map[string]interface{}{"provider": "vmware_desktop"} 18 19 // Copy all of the original contents into the temporary directory 20 for _, path := range artifact.Files() { 21 ui.Message(fmt.Sprintf("Copying: %s", path)) 22 23 dstPath := filepath.Join(dir, filepath.Base(path)) 24 if err = CopyContents(dstPath, path); err != nil { 25 return 26 } 27 } 28 29 return 30 }