packer-cn/builder/amazon/chroot/copy_files.go

18 lines
376 B
Go
Raw Normal View History

2013-09-26 03:58:25 -04:00
package chroot
import (
2013-09-26 04:32:53 -04:00
"fmt"
2013-09-26 03:58:25 -04:00
"os/exec"
2013-09-26 21:28:06 -04:00
"log"
2013-09-26 03:58:25 -04:00
)
2013-09-26 04:32:53 -04:00
func copySingle(dest string, src string, copyCommand string) error {
2013-09-26 05:25:57 -04:00
cpCommand := fmt.Sprintf("%s %s %s", copyCommand, src, dest)
2013-09-26 04:32:53 -04:00
localCmd := exec.Command("/bin/sh", "-c", cpCommand)
2013-09-26 22:11:28 -04:00
log.Printf("Executing copy: %s %#v", localCmd.Path, localCmd.Args)
2013-09-26 04:32:53 -04:00
if err := localCmd.Run(); err != nil {
return err
2013-09-26 03:58:25 -04:00
}
return nil
}