Files

40 lines
606 B
Go
Raw Permalink Normal View History

// Copyright (c) HashiCorp, Inc.
2023-08-10 15:53:29 -07:00
// SPDX-License-Identifier: BUSL-1.1
package compress
import (
"fmt"
"os"
)
2015-06-10 14:04:24 -07:00
const BuilderId = "packer.post-processor.compress"
type Artifact struct {
2017-03-28 18:02:51 -07:00
Path string
}
func (a *Artifact) BuilderId() string {
return BuilderId
}
func (*Artifact) Id() string {
return ""
}
func (a *Artifact) Files() []string {
2015-06-18 05:13:48 -07:00
return []string{a.Path}
}
func (a *Artifact) String() string {
return fmt.Sprintf("compressed artifacts in: %s", a.Path)
}
2014-01-19 18:32:44 +00:00
func (*Artifact) State(name string) interface{} {
return nil
}
func (a *Artifact) Destroy() error {
return os.Remove(a.Path)
}