Skip to content

Commit fdc1738

Browse files
committed
add log when copying files/directories between host and containers (both way)
Signed-off-by: Guillaume Lours <[email protected]>
1 parent 2336d9f commit fdc1738

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/compose/cp.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ func (s *composeService) Copy(ctx context.Context, projectName string, options a
8282
for _, cont := range containers {
8383
container := cont
8484
g.Go(func() error {
85-
err := copyFunc(ctx, container.ID, srcPath, dstPath, options)
86-
if s.dryRun && err == nil {
87-
fromOrInside := "inside"
88-
if direction == fromService {
89-
fromOrInside = "from"
90-
}
91-
fmt.Printf("Copy %s to path %s %s %s service container\n", srcPath, dstPath, fromOrInside, getCanonicalContainerName(container))
85+
if err := copyFunc(ctx, container.ID, srcPath, dstPath, options); err != nil {
86+
return err
9287
}
93-
return err
88+
fromOrInside := "inside"
89+
if direction == fromService {
90+
fromOrInside = "from"
91+
}
92+
fmt.Fprintf(s.stderr(), "Copy %s to path %s %s %s service container\n", srcPath, dstPath, fromOrInside, getCanonicalContainerName(container))
93+
return nil
9494
})
9595
}
9696

0 commit comments

Comments
 (0)