More flexible auto-update locations

This commit is contained in:
catbref 2019-06-06 18:21:25 +01:00
parent 1d7bda5d46
commit 4ced9cc3e2
2 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ public class AutoUpdate extends Thread {
private static boolean attemptUpdate(byte[] commitHash, byte[] downloadHash, String repoBaseUri) { private static boolean attemptUpdate(byte[] commitHash, byte[] downloadHash, String repoBaseUri) {
LOGGER.info(String.format("Fetching update from %s", repoBaseUri)); LOGGER.info(String.format("Fetching update from %s", repoBaseUri));
InputStream in = ApiRequest.fetchStream(repoBaseUri + "/raw/" + HashCode.fromBytes(commitHash).toString() + "/" + JAR_FILENAME); InputStream in = ApiRequest.fetchStream(String.format(repoBaseUri, HashCode.fromBytes(commitHash).toString()));
if (in == null) { if (in == null) {
LOGGER.warn(String.format("Failed to fetch update from %s", repoBaseUri)); LOGGER.warn(String.format("Failed to fetch update from %s", repoBaseUri));
return false; // failed - try another repo return false; // failed - try another repo

View File

@ -83,7 +83,7 @@ public class Settings {
// Auto-update sources // Auto-update sources
private String[] autoUpdateRepos = new String[] { private String[] autoUpdateRepos = new String[] {
"https://github.com/catbref/qora-core" "https://github.com/catbref/qora-core/raw/%s/qora-core.jar"
}; };
// Constructors // Constructors