Skip to content

Commit

Permalink
fix pack loading to accept arbitrary pack names
Browse files Browse the repository at this point in the history
  • Loading branch information
svilupp committed Aug 18, 2024
1 parent 0f2bdb0 commit 45a424c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ load_index!(:julia)
Or multiple packs
```julia
load_index!([:julia, :makie,:tidier])
load_index!([:julia, :juliadata, :makie, :tidier, :plots, :sciml])
```
But we recommend loading ONLY the packs you expect to need - unnecessary packs introduce noise.
"""
function load_index!(
packs::Vector{Symbol} = LOADED_PACKS[]; verbose::Bool = true, kwargs...)
Expand All @@ -73,7 +74,12 @@ function load_index!(
indices = RT.ChunkIndex[]
for pack in packs
artifact_path = @artifact_str("$(pack)__$(config_key)")
index = load_index_hdf5(joinpath(artifact_path, "pack.hdf5"); verbose = false)
path = if isfile(joinpath(artifact_path, "pack.hdf5"))
joinpath(artifact_path, "pack.hdf5")
else
filter(x -> endswith(x, "hdf5"), readdir(artifact_path; join = true)) |> only
end
index = load_index_hdf5(path; verbose = false)
push!(indices, index)
end
# TODO: dedupe the index
Expand Down

0 comments on commit 45a424c

Please # to comment.