This commit is contained in:
Matthew Hooker 2013-09-26 18:34:01 -07:00
parent c15bb28491
commit de83755c00
1 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"log"
"os/exec"
"path/filepath"
)
@ -56,7 +57,9 @@ func (s *StepCopyFiles) CleanupFunc(multistep.StateBag) error {
if s.files != nil {
for _, file := range s.files {
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
}
}