From 1dd10f936915930028e8457c1d828a6535069280 Mon Sep 17 00:00:00 2001 From: mrjoelkamp Date: Wed, 10 Apr 2024 14:26:24 -0500 Subject: [PATCH] fix: deep targets file path Signed-off-by: mrjoelkamp --- metadata/updater/updater.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/metadata/updater/updater.go b/metadata/updater/updater.go index 918131c9..b741fefb 100644 --- a/metadata/updater/updater.go +++ b/metadata/updater/updater.go @@ -234,10 +234,11 @@ func (update *Updater) DownloadTarget(targetFile *metadata.TargetFiles, filePath hashes = hex.EncodeToString(v) break } - dirName, baseName, ok := strings.Cut(targetFilePath, "/") + baseName := filepath.Base(targetFilePath) + dirName, ok := strings.CutSuffix(targetFilePath, baseName) if !ok { // . - targetRemotePath = fmt.Sprintf("%s.%s", hashes, dirName) + targetRemotePath = fmt.Sprintf("%s.%s", hashes, baseName) } else { // /. targetRemotePath = fmt.Sprintf("%s/%s.%s", dirName, hashes, baseName)