1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
package generators
import (
"os"
"path/filepath"
"github.com/lxc/distrobuilder/image"
"github.com/lxc/distrobuilder/shared"
)
type remove struct {
common
}
// RunLXC removes a path.
func (g *remove) RunLXC(img *image.LXCImage, target shared.DefinitionTargetLXC) error {
return g.Run()
}
// RunIncus removes a path.
func (g *remove) RunIncus(img *image.IncusImage, target shared.DefinitionTargetIncus) error {
return g.Run()
}
// Run removes a path.
func (g *remove) Run() error {
return os.RemoveAll(filepath.Join(g.sourceDir, g.defFile.Path))
}
|