mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-26 18:30:52 +01:00
better version checking
This commit is contained in:
parent
1556f3f5d5
commit
2f61ac8fb6
@ -17,6 +17,7 @@ import javafx.scene.layout.Region;
|
|||||||
import javafx.scene.web.WebView;
|
import javafx.scene.web.WebView;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
import org.apache.maven.artifact.versioning.ComparableVersion;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -78,7 +79,7 @@ public class Main extends Application {
|
|||||||
new URL(gitApi).openStream(), StandardCharsets.UTF_8));
|
new URL(gitApi).openStream(), StandardCharsets.UTF_8));
|
||||||
|
|
||||||
String gitv = (String)object.get("tag_name");
|
String gitv = (String)object.get("tag_name");
|
||||||
if (!gitv.equals(version)) {
|
if (new ComparableVersion(version).compareTo(new ComparableVersion(gitv)) < 0) {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
String body = (String)object.get("body");
|
String body = (String)object.get("body");
|
||||||
boolean isForcedUpdate = body.contains("(!)");
|
boolean isForcedUpdate = body.contains("(!)");
|
||||||
|
Loading…
Reference in New Issue
Block a user