wip
This commit is contained in:
parent
6d158eaa29
commit
ccd9b56f9c
|
@ -5,6 +5,7 @@ import (
|
||||||
"github.com/mitchellh/multistep"
|
"github.com/mitchellh/multistep"
|
||||||
"github.com/mitchellh/packer/packer"
|
"github.com/mitchellh/packer/packer"
|
||||||
"log"
|
"log"
|
||||||
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -56,7 +57,9 @@ func (s *StepCopyFiles) CleanupFunc(multistep.StateBag) error {
|
||||||
if s.files != nil {
|
if s.files != nil {
|
||||||
for _, file := range s.files {
|
for _, file := range s.files {
|
||||||
log.Printf("Removing: %s", file)
|
log.Printf("Removing: %s", file)
|
||||||
if err := copySingle(file, "", "rm"); err != nil {
|
chrootCommand := fmt.Sprintf("rm %s", file)
|
||||||
|
localCmd := exec.Command("/bin/sh", "-c", chrootCommand)
|
||||||
|
if err := localCmd.Run(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue