From d94af21cacab389c9cf05b11525401d75da4ecfe Mon Sep 17 00:00:00 2001 From: Dimitris Sotirakis Date: Tue, 4 Oct 2022 17:18:07 +0300 Subject: [PATCH] Replace filename with path without the local dir (#56296) --- pkg/build/gcloud/storage/gsutil.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/build/gcloud/storage/gsutil.go b/pkg/build/gcloud/storage/gsutil.go index ca3484c5df7..461fd58c98a 100644 --- a/pkg/build/gcloud/storage/gsutil.go +++ b/pkg/build/gcloud/storage/gsutil.go @@ -268,8 +268,9 @@ func ListLocalFiles(dir string) ([]File, error) { err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { if !info.IsDir() { files = append(files, File{ - FullPath: path, - PathTrimmed: info.Name(), + FullPath: path, + // Strip the dir name from the filepath + PathTrimmed: strings.ReplaceAll(path, dir, ""), }) } return nil