Skip to content

Commit 9103ed0

Browse files
fix(list): skip products with non-semver versions
The registry now contains products with non-semver version strings (e.g. `dev`). `product_metadata()` uses `tryparse` instead of `VersionNumber` to silently skip these rather than throwing.
1 parent d52e88d commit 9103ed0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/PumasProductManager.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,13 @@ end
172172

173173
function product_metadata()
174174
ids = products()
175-
return map(ids) do id
175+
metadata = Tuple{SubString{String},VersionNumber}[]
176+
for id in ids
176177
name, version = split(id, "@"; limit = 2)
177-
return name, VersionNumber(version)
178+
v = tryparse(VersionNumber, version)
179+
isnothing(v) || push!(metadata, (name, v))
178180
end
181+
return metadata
179182
end
180183

181184
function list(io = stdout)

0 commit comments

Comments
 (0)