Skip to content

Commit

Permalink
Detect if the registry is already installed via tarball (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Dec 19, 2022
1 parent 139ec78 commit f813042
Showing 1 changed file with 13 additions and 2 deletions.
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

0 comments on commit f813042

Please sign in to comment.