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
  • Loading branch information
IanButterworth authored Jan 27, 2021
1 parent 695d019 commit 4ffa905
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Registry/Registry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function download_registries(io::IO, regs::Vector{RegistrySpec}, depot::String=d
# copy to `depot`
regpath = joinpath(depot, "registries", registry.name)
ispath(dirname(regpath)) || mkpath(dirname(regpath))
if isdir_nothrow(regpath)
if isfile(joinpath(regpath, "Registry.toml"))
existing_registry = Registry.RegistryInstance(regpath; parse_packages=false)
if registry.uuid == existing_registry.uuid
println(io,
Expand All @@ -188,7 +188,8 @@ function download_registries(io::IO, regs::Vector{RegistrySpec}, depot::String=d
"`$(Base.contractuser(joinpath(depot, "registries", registry.name*"-2")))`."))
end
else
mv(tmp, regpath)
# if the dir doesn't exist, or exists but doesn't contain a Registry.toml
mv(tmp, regpath, force=true)
printpkgstyle(io, :Added, "registry `$(registry.name)` to `$(Base.contractuser(regpath))`")
end
end
Expand Down

0 comments on commit 4ffa905

Please sign in to comment.