Closed AMythicDev closed 5 months ago
in practice it's always the second entry in the file
That's mostly because of how zig is being released. Let's say if there's a 0.11.1, will it be at the top or right right above 0.11.0 or where? I feel there are quite a many possibilities of failure by taking this assumption.
you have all the data you need with semantic versioning.
@andrewrk just a side question, if there's a patch release, say 0.11.1 where will it be placed in the download.json file? Will it be right under master
like where 0.12.0 is right now or will be somewhere adjacent to 0.11.0?
JSON object keys are not ordered.
Thanks, I am going with the semantic version analysis method.
I am writing a version manager for Zig called
zigvm
and currently it can install releases from semver ormaster
. Additionally I would also like to be able to install the latest stable release with it by saying something likezigvm install stable
.My current approach to this would be to loop over the semver and compare them till I find the greatest of them. But I find this more of a naive and slow solution. I think if the
download.json
can describe the current stable release by something like"stable": true
or"tags": ["stable"]
or maybe a separate entry likestable
that would basically be an alias to the current stable release, we can avoid all the comparisons an simply check which release has the stable tag.