* Put modloader version data in struct for legibility
* Create modloader map from list
This is a minor change, but it prevents any errors with the keys not being equal to the modloader's Name field
* Less anonymous functions in modloader version retrieval
With previous code, almost everything was lazy and returned a function. Changed this to only have anonymous function in the modloader definitions, and the rest of the functions all just execute their results immediately instead or returning a function. Makes for a bit more legible code.
* Simplify FetchMavenVersionFiltered
* Rewrite version retrieval
* Use Errorf in versionutil
* Remove httpclient parameter
turned out not to be needed
* Add testing for version retrieval
* Explain fetchMavenWithFilterMap
* Always download files into cache
Previous implementation would skip downloading the file if no new hashes were requested. Issue is that the curseforge and modrinth exports require the file contents. Not retrieving the file violates these assumptions. Instead of creating new parameters to force a file download, I changed the code to simply always download instead. This seems like reasonable behaviour for a cache. This fixes#296
* Bump cache index version, delete potentially broken files from old version
Since an unrecognized loader has an index of -1, and since lower number indicate a better loader, an unrecognized loader (when found in b) would immediately be assumed to be a great loader. Since the loop for A properly handles it, B would always be assumed to be the best, which has quite wrong consequences.
Since the compatibility check only verified that the first characters matched
between the version strings, a one-character patch version could be
misinterpreted if a two-character patch version existed.
Since nix tries to update inputs on newer versions out of, I suppose,
some introduced incompatibility, `nix build` fails. And nixpkgs from
2023 sounds rather obsolete at this point, so update was kinda due I
think.
On newer versions of nixpkgs however buildGoModule has changed and
requires one of its arguments to be called vendorHash and not
vendorSha256, this patch changes that as well.
Fixes#297, closes#314, closes#307
if a branch is specified, but a release cannot be found on that branch, return an error instead of simply the latest release
Signed-off-by: unilock <unilock@fennet.rentals>