Skip to content

Instantly share code, notes, and snippets.

@falseresync
Last active January 28, 2021 11:33
Show Gist options
  • Save falseresync/c1beb98e7895b843df58c6cabd57ee3c to your computer and use it in GitHub Desktop.
Save falseresync/c1beb98e7895b843df58c6cabd57ee3c to your computer and use it in GitHub Desktop.
UpdatesFetcher.instance()
.updateFor("modid") // returns an optional or maybe a future
.ifPresent(update -> {
System.out.println(update.url());
});
{
// ...
"updates": "https://raw.githubusercontent.com/user/repo/master/modid.updates.json"
// ...
}
{
"schemaVersion": 1,
"latest": {
"release": "1.0.1",
"snapshot": "1.1.0-pre1"
},
"versions": [
{
"id": "1.1.0-pre1",
"type": "snapshot",
"url": "https://github.com/user/repo/releases/tag/1.1.0-pre1"
},
{
"id": "1.0.1",
"type": "release",
"url": "https://github.com/user/repo/releases/tag/1.0.1"
},
{
"id": "1.0.0",
"type": "release",
"url": "https://github.com/user/repo/releases/tag/1.0.0"
},
{
"id": "1.0.0-pre1",
"type": "snapshot",
"url": "https://github.com/user/repo/releases/tag/1.0.0-pre1"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment