diff --git a/src/RegistryTools.jl b/src/RegistryTools.jl index 6a10ae3..16d0f2e 100644 --- a/src/RegistryTools.jl +++ b/src/RegistryTools.jl @@ -11,6 +11,14 @@ using Pkg: Pkg, TOML, GitTools using UUIDs const DEFAULT_REGISTRY_URL = "https://github.com/JuliaRegistries/General" +const PKG_HAS_WEAK = hasfield(Pkg.Types.Project, :_deps_weak) + +function __init__() + if !PKG_HAS_WEAK + @warn "Running Registrator on a Julia version that does not support weak dependencies. \ + Weak dependencies will not be registered." + end +end include("Compress.jl") include("builtin_pkgs.jl") diff --git a/src/register.jl b/src/register.jl index b521cbb..9e5f054 100644 --- a/src/register.jl +++ b/src/register.jl @@ -47,8 +47,6 @@ for the project file in that tree and a hash string for the tree. # end # end -const PKG_HAS_WEAK = hasfield(Pkg.Types.Project, :_deps_weak) - function getdeps(pkg) if PKG_HAS_WEAK return merge(pkg.deps, pkg._deps_weak)