Skip to content

Commit

Permalink
fix for copy command - from remote to local (#3749)
Browse files Browse the repository at this point in the history
fix for copy from remote to local
  • Loading branch information
numcys authored and nightfury1204 committed Nov 12, 2024
1 parent abfbd77 commit 5f1cab7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/helpers/tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ func RebaseArchive(r io.Reader, src, dst string) (io.Reader, error) {
h.Name = fmt.Sprintf("/%s", h.Name)
}

if !strings.HasPrefix(h.Name, src) {
// the second check - strings.HasSuffix(h.Name, "/") is for checking if the src provided is a single file, if it is then it should not be skipped --
if !strings.HasPrefix(h.Name, src) && strings.HasSuffix(h.Name, "/") {
continue
}

Expand Down

0 comments on commit 5f1cab7

Please sign in to comment.