mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 00:40:51 +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.stage.Stage;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.maven.artifact.versioning.ComparableVersion;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -78,7 +79,7 @@ public class Main extends Application {
|
||||
new URL(gitApi).openStream(), StandardCharsets.UTF_8));
|
||||
|
||||
String gitv = (String)object.get("tag_name");
|
||||
if (!gitv.equals(version)) {
|
||||
if (new ComparableVersion(version).compareTo(new ComparableVersion(gitv)) < 0) {
|
||||
Platform.runLater(() -> {
|
||||
String body = (String)object.get("body");
|
||||
boolean isForcedUpdate = body.contains("(!)");
|
||||
|
Loading…
Reference in New Issue
Block a user