2013-06-06 18:12:54 -04:00
|
|
|
package vmware
|
|
|
|
|
2013-06-18 19:01:14 -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 {
|
|
|
|
dir string
|
|
|
|
f []string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*Artifact) BuilderId() string {
|
|
|
|
return BuilderId
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
2013-06-18 19:01:14 -04:00
|
|
|
|
|
|
|
func (a *Artifact) Destroy() error {
|
|
|
|
return os.RemoveAll(a.dir)
|
|
|
|
}
|