File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import oshi .PlatformEnum ;
88import oshi .SystemInfo ;
99import oshi .software .os .OperatingSystem ;
10+ import io .github .g00fy2 .versioncompare .Version ;
1011
1112import java .io .BufferedReader ;
1213import java .io .IOException ;
@@ -39,7 +40,7 @@ public static boolean isLinux() {
3940 }
4041
4142 public static boolean isMacOsMojaveOrLater () {
42- return hasTypeAndVersionOrHigher (PlatformEnum .MACOSX , "10.14" );
43+ return hasTypeAndVersionOrHigher (PlatformEnum .MACOS , "10.14" );
4344 }
4445
4546 public static boolean isGnome () {
@@ -54,12 +55,12 @@ public static boolean hasType(PlatformEnum platformType) {
5455 return OsInfo .platformType .equals (platformType );
5556 }
5657
57- public static boolean hasVersionOrHigher (String version ) {
58- return parseVersion (OsInfo .version ) >= parseVersion (version );
58+ public static boolean isVersionAtLeast (String version ) {
59+ return new Version (OsInfo .version ). isAtLeast (version );
5960 }
6061
6162 public static boolean hasTypeAndVersionOrHigher (PlatformEnum platformType , String version ) {
62- return hasType (platformType ) && hasVersionOrHigher (version );
63+ return hasType (platformType ) && isVersionAtLeast (version );
6364 }
6465
6566 public static String getVersion () {
Original file line number Diff line number Diff line change 55 requires org .jetbrains .annotations ;
66 requires com .sun .jna ;
77 requires com .github .oshi ;
8+ requires versioncompare ;
89
910 exports com .jthemedetecor ;
1011
You can’t perform that action at this time.
0 commit comments