Skip to content

Commit

Permalink
fix: deep targets file path
Browse files Browse the repository at this point in the history
Signed-off-by: mrjoelkamp <[email protected]>
  • Loading branch information
mrjoelkamp committed Apr 10, 2024
1 parent 1e7978e commit 1dd10f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions metadata/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
// <hash>.<target-name>
targetRemotePath = fmt.Sprintf("%s.%s", hashes, dirName)
targetRemotePath = fmt.Sprintf("%s.%s", hashes, baseName)
} else {
// <dir-prefix>/<hash>.<target-name>
targetRemotePath = fmt.Sprintf("%s/%s.%s", dirName, hashes, baseName)
Expand Down

0 comments on commit 1dd10f9

Please sign in to comment.