Skip to content

Commit

Permalink
overwrite registry folders that don't contain a Registry.toml (JuliaL…
Browse files Browse the repository at this point in the history
…ang#2356)

(cherry picked from commit 4ffa905)
  • Loading branch information
IanButterworth authored and KristofferC committed Jan 28, 2021
1 parent a6f4a38 commit 5a5ee40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Types.jl
Expand Up @@ -1031,7 +1031,7 @@ function clone_or_cp_registries(ctx::Context, regs::Vector{RegistrySpec}, depot:
# slug = Base.package_slug(UUID(registry["uuid"]))
regpath = joinpath(depot, "registries", registry["name"]::String#=, slug=#)
ispath(dirname(regpath)) || mkpath(dirname(regpath))
if Pkg.isdir_nothrow(regpath)
if isfile(joinpath(regpath, "Registry.toml"))
existing_registry = read_registry(joinpath(regpath, "Registry.toml"))
if registry["uuid"] == existing_registry["uuid"]
println(ctx.io,
Expand All @@ -1043,7 +1043,7 @@ function clone_or_cp_registries(ctx::Context, regs::Vector{RegistrySpec}, depot:
"`$(Base.contractuser(joinpath(depot, "registries", registry["name"]*"-2")))`."))
end
else
mv(tmp, regpath)
mv(tmp, regpath, force=true)
printpkgstyle(ctx, :Added, "registry `$(registry["name"])` to `$(Base.contractuser(regpath))`")
end
end
Expand Down

0 comments on commit 5a5ee40

Please sign in to comment.