Skip to content

Commit

Permalink
add a warning if running on old Julia versions
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Dec 12, 2022
1 parent 1bbc788 commit d5a30f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/RegistryTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 0 additions & 2 deletions src/register.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d5a30f7

Please sign in to comment.