mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #8906 from dqminh/remove-copy-directory
change util.CopyDirectory to archive.CopyWithTar
This commit is contained in:
commit
edae8830a9
1 changed files with 2 additions and 9 deletions
|
@ -22,6 +22,7 @@ import (
|
|||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/docker/docker/dockerversion"
|
||||
"github.com/docker/docker/pkg/archive"
|
||||
"github.com/docker/docker/pkg/fileutils"
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
)
|
||||
|
@ -250,14 +251,6 @@ func HashData(src io.Reader) (string, error) {
|
|||
return "sha256:" + hex.EncodeToString(h.Sum(nil)), nil
|
||||
}
|
||||
|
||||
// FIXME: this is deprecated by CopyWithTar in archive.go
|
||||
func CopyDirectory(source, dest string) error {
|
||||
if output, err := exec.Command("cp", "-ra", source, dest).CombinedOutput(); err != nil {
|
||||
return fmt.Errorf("Error copy: %s (%s)", err, output)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type WriteFlusher struct {
|
||||
sync.Mutex
|
||||
w io.Writer
|
||||
|
@ -381,7 +374,7 @@ func TestDirectory(templateDir string) (dir string, err error) {
|
|||
return
|
||||
}
|
||||
if templateDir != "" {
|
||||
if err = CopyDirectory(templateDir, dir); err != nil {
|
||||
if err = archive.CopyWithTar(templateDir, dir); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue