packer-cn/post-processor/compress/artifact.go

41 lines
637 B
Go
Raw Normal View History

package compress
import (
"fmt"
"os"
)
2014-09-08 13:28:16 -04:00
const BuilderId = "packer.post-processor.compress"
type Artifact struct {
Path string
Provider string
}
func NewArtifact(provider, path string) *Artifact {
return &Artifact{
Path: path,
Provider: provider,
}
}
func (*Artifact) BuilderId() string {
return BuilderId
}
func (self *Artifact) Id() string {
return ""
}
func (self *Artifact) Files() []string {
return []string{self.Path}
}
func (self *Artifact) String() string {
return fmt.Sprintf("'%s' compressing: %s", self.Provider, self.Path)
}
func (self *Artifact) Destroy() error {
return os.Remove(self.Path)
}