Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support detecting if the registry is already installed via tarball #25

Merged
merged 2 commits into from
Dec 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions add_general_registry.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
using Pkg

function general_registry_location()
function tarball_general_registry_location()
reg_dir = joinpath(DEPOT_PATH[1], "registries")
general_registry_tarball = joinpath(reg_dir, "General.tar.gz")
registry_toml_file = joinpath(reg_dir, "General.toml")
return general_registry_tarball, registry_toml_file
end

function cloned_general_registry_location()
general_registry_dir = joinpath(DEPOT_PATH[1], "registries", "General")
registry_toml_file = joinpath(general_registry_dir, "Registry.toml")
return general_registry_dir, registry_toml_file
end

function general_registry_exists()
general_registry_dir, registry_toml_file = general_registry_location()
general_registry_tarball, registry_toml_file = tarball_general_registry_location()
if isfile(general_registry_tarball) && isfile(registry_toml_file)
return true
end
general_registry_dir, registry_toml_file = cloned_general_registry_location()
if !isdir(general_registry_dir)
return false
elseif !isfile(registry_toml_file)
Expand Down