Merge pull request #5234 from hashicorp/filecopy_5221

fix file copy script to prevent error when encountering empty directory
This commit is contained in:
Matthew Hooker 2017-08-09 16:08:57 -07:00 committed by GitHub
commit a6c97311b3
1 changed files with 1 additions and 1 deletions

View File

@ -173,7 +173,7 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
// Make the directory, then copy into it
cmd := &packer.RemoteCmd{
Command: fmt.Sprintf("set -e; mkdir -p %s; cd %s; command cp -R `ls -A .` %s",
Command: fmt.Sprintf("set -e; mkdir -p %s; command cp -R %s/ %s",
containerDst, containerSrc, containerDst),
}
if err := c.Start(cmd); err != nil {