Skip to content

Commit 01630b1

Browse files
authored
[Prefix] Remove assumption that URL of GitSource must end with .git (#213)
1 parent 7639cab commit 01630b1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Prefix.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,8 @@ end
261261

262262
function setup(source::SetupSource{GitSource}, targetdir, verbose)
263263
mkpath(targetdir)
264-
# Chop off the `.git-$(sha256(url))` at the end of the source.path
265-
name = basename(source.path)
266-
m = match(r"(.*)\.git-[0-9a-fA-F]{64}$", name)
267-
if m !== nothing
268-
name = m.captures[1]
269-
end
264+
# Chop off the `.git-$(sha256(url))` at the end of the source.path (`.git` is optional).
265+
name = replace(basename(source.path), r"(\.git)?-[0-9a-fA-F]{64}$" => "")
270266
repo_dir = joinpath(targetdir, name)
271267
if verbose
272268
# Need to strip the trailing separator

0 commit comments

Comments
 (0)