Skip to content

Commit

Permalink
add log when copying files/directories between host and containers (b…
Browse files Browse the repository at this point in the history
…oth way)

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
  • Loading branch information
glours committed Feb 3, 2023
1 parent 9dc6789 commit 280b04f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/compose/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}

Expand Down

0 comments on commit 280b04f

Please sign in to comment.