|
|
|
|
@ -5,7 +5,6 @@ import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"github.com/mitchellh/mapstructure"
|
|
|
|
|
"github.com/mitchellh/packer/packer"
|
|
|
|
|
"io"
|
|
|
|
|
"io/ioutil"
|
|
|
|
|
"log"
|
|
|
|
|
"os"
|
|
|
|
|
@ -66,19 +65,9 @@ func (p *VBoxBoxPostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifac
|
|
|
|
|
// Copy all of the original contents into the temporary directory
|
|
|
|
|
for _, path := range artifact.Files() {
|
|
|
|
|
ui.Message(fmt.Sprintf("Copying: %s", path))
|
|
|
|
|
src, err := os.Open(path)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, false, err
|
|
|
|
|
}
|
|
|
|
|
defer src.Close()
|
|
|
|
|
|
|
|
|
|
dst, err := os.Create(filepath.Join(dir, filepath.Base(path)))
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, false, err
|
|
|
|
|
}
|
|
|
|
|
defer dst.Close()
|
|
|
|
|
|
|
|
|
|
if _, err := io.Copy(dst, src); err != nil {
|
|
|
|
|
dstPath := filepath.Join(dir, filepath.Base(path))
|
|
|
|
|
if err := CopyContents(dstPath, path); err != nil {
|
|
|
|
|
return nil, false, err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|