packer-cn/builder/vmware/iso/artifact.go

35 lines
567 B
Go
Raw Normal View History

2013-12-24 00:58:41 -05:00
package iso
2013-06-06 18:12:54 -04:00
import (
"fmt"
"os"
)
2013-06-06 18:12:54 -04:00
// Artifact is the result of running the VMware builder, namely a set
// of files associated with the resulting machine.
type Artifact struct {
builderId string
dir string
f []string
2013-06-06 18:12:54 -04:00
}
func (a *Artifact) BuilderId() string {
return a.builderId
2013-06-06 18:12:54 -04:00
}
func (a *Artifact) Files() []string {
return a.f
}
func (*Artifact) Id() string {
return "VM"
}
func (a *Artifact) String() string {
return fmt.Sprintf("VM files in directory: %s", a.dir)
}
func (a *Artifact) Destroy() error {
return os.RemoveAll(a.dir)
}