-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mappings-latest
function to Clojure sandbox
#64
base: master
Are you sure you want to change the base?
Conversation
29d7b5a
to
02c4e91
Compare
|
||
|
||
public static CommandMappings<?> getMappingsCommand(String channel) { | ||
switch (channel.toLowerCase(Locale.ROOT)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say use this as a fallback, I see no reason why "mcp", "moj", etc would not be valid. Also what about yarn?
final TypeBinding<MappingInfo> mappingBinding = new TypeBinding<MappingInfo>("MappingInfo") | ||
.bind("channel", MappingInfo::getChannel) | ||
.bind("stable", MappingInfo::isStable) | ||
.bind("version", cmd -> cmd.getDownloader().getMappingsVersion(cmd.getMcVersion(), cmd.isStable()).block()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling into the downloader is not a good idea, if this triggers a web request it will fail within trick context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will it fail? I specifically tried to query stuff I did not have downloaded and it seemed to work fine
This is a simple PR that adds a new static method to
MappingDownloader
, which takes in a channel string and outputs the latest version for that string. A function is also added to the sandbox init clojure file to support this. This is useful for a trick that I am making. I confirmed it to work in nREPL.