add log when copying files/directories between host and containers (both way)

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours 2023-02-03 16:20:35 +01:00
parent 2336d9fe35
commit fdc1738143
1 changed files with 8 additions and 8 deletions

View File

@ -82,15 +82,15 @@ func (s *composeService) Copy(ctx context.Context, projectName string, options a
for _, cont := range containers {
container := cont
g.Go(func() error {
err := copyFunc(ctx, container.ID, srcPath, dstPath, options)
if s.dryRun && err == nil {
fromOrInside := "inside"
if direction == fromService {
fromOrInside = "from"
}
fmt.Printf("Copy %s to path %s %s %s service container\n", srcPath, dstPath, fromOrInside, getCanonicalContainerName(container))
if err := copyFunc(ctx, container.ID, srcPath, dstPath, options); err != nil {
return err
}
return err
fromOrInside := "inside"
if direction == fromService {
fromOrInside = "from"
}
fmt.Fprintf(s.stderr(), "Copy %s to path %s %s %s service container\n", srcPath, dstPath, fromOrInside, getCanonicalContainerName(container))
return nil
})
}