From 350462b7de5e5fa3d07692742ce88787ad003da2 Mon Sep 17 00:00:00 2001 From: Naman Sharma Date: Sun, 10 Nov 2024 21:13:40 +0530 Subject: [PATCH] fix for copy from remote to local --- pkg/helpers/tar.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/helpers/tar.go b/pkg/helpers/tar.go index 92920217d..6503de6c7 100644 --- a/pkg/helpers/tar.go +++ b/pkg/helpers/tar.go @@ -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 }