Skip to content

Commit

Permalink
Update prefix handling
Browse files Browse the repository at this point in the history
Signed-off-by: Vihang Mehta <[email protected]>
  • Loading branch information
vihangm committed May 25, 2024
1 parent 9f95781 commit 90d2490
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/regclient/deps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,16 @@ function deps.mirrorImgs(images, prefix)
repo = string.sub(repo, i+1)
end

-- if a prefix was provided, prepend it to the repo
-- if a prefix was provided, prepend it to the repo (but drop all existing namespacing)
if string.len(prefix) > 0 then
repo = prefix .. "/" .. repo
local repoRev = string.reverse(repo)
-- find the last slash in the repo
local i = string.find(repoRev, "/", 1, true)
if i then
-- grab the repo parts adter the last slash
repo = string.reverse(string.sub(repoRev, 0, i-1))
end
repo = prefix .. "-" .. repo
end

-- loop through destinations
Expand Down

0 comments on commit 90d2490

Please sign in to comment.