Skip to content

Commit

Permalink
Fix for nothing in in_memory_registry
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHatherly committed Jun 20, 2024
1 parent 4744d36 commit 1b67ebe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
39 changes: 27 additions & 12 deletions src/code_stripping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,21 +255,36 @@ function _process_reg_info(reg)

# Potentially is `nothing`.
mem = reg.in_memory_registry
isnothing(mem) && return dict

for key in keys(reg.in_memory_registry)
key == "Registry.toml" && continue
if isnothing(mem)
for (root, _, files) in walkdir(reg.path)
for file in files
file in ("Registry.toml", "Project.toml") && continue
_, ext = splitext(file)
if ext == ".toml"
fullpath = joinpath(root, file)
parts = splitpath(relpath(fullpath, reg.path))
path = join(parts[1:end-1], '/')
file = parts[end]
pkg = get!(Dict, dict, path)
pkg[file] = TOML.parsefile(fullpath)
end
end
end
else
for key in keys(reg.in_memory_registry)
key == "Registry.toml" && continue

parts = split(key, '/')
path = join(parts[1:end-1], '/')
file = parts[end]
parts = split(key, '/')
path = join(parts[1:end-1], '/')
file = parts[end]

path == ".ci" && continue
file == "Project.toml" && continue
path == ".ci" && continue
file == "Project.toml" && continue

if endswith(file, ".toml")
pkg = get!(Dict, dict, path)
pkg[file] = TOML.parse(reg.in_memory_registry[key])
if endswith(file, ".toml")
pkg = get!(Dict, dict, path)
pkg[file] = TOML.parse(reg.in_memory_registry[key])
end
end
end
return dict
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ end
@test isfile(key.private)
@test isfile(key.public)

# PackageBundler.bundle()
PackageBundler.bundle()
end

mktempdir() do script_dir
Expand Down

0 comments on commit 1b67ebe

Please sign in to comment.