From 719cb576830c314cdb3f5ea55a7603ba39aeb9fe Mon Sep 17 00:00:00 2001 From: Ne_Eo Date: Mon, 22 Jul 2024 11:18:40 +0200 Subject: [PATCH] Fix Version check --- commandline/commands/Setup.hx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/commandline/commands/Setup.hx b/commandline/commands/Setup.hx index 94af0a43..f259f46f 100644 --- a/commandline/commands/Setup.hx +++ b/commandline/commands/Setup.hx @@ -189,21 +189,21 @@ class Setup { final proc = new Process('haxe --version'); proc.exitCode(true); final haxeVer = proc.stdout.readLine(); - if (haxeVer != "4.2.5" || haxeVer != "4.3.4") { - // check for outdated haxe - final curHaxeVer = [for(v in haxeVer.split(".")) Std.parseInt(v)]; - final requiredHaxeVer = [4, 2, 5]; - for(i in 0...requiredHaxeVer.length) { - if (curHaxeVer[i] < requiredHaxeVer[i]) { - prettyPrint([ - "!! WARNING !!", - "Your current Haxe version is outdated.", - 'You\'re using ${haxeVer}, whilst the required version is 4.2.5 or newer.', - 'The engine may not compile with your current version of Haxe.', - 'We recommend upgrading to 4.2.5 or newer' - ].join("\n")); - break; - } + + // check for outdated haxe + final curHaxeVer = [for(v in haxeVer.split(".")) Std.parseInt(v)]; + final minumumVersion = [4, 2, 5]; + for(i in 0...minumumVersion.length) { + if (curHaxeVer[i] > minumumVersion[i]) break; + if (curHaxeVer[i] < minumumVersion[i]) { + prettyPrint([ + "!! WARNING !!", + "Your current Haxe version is outdated.", + 'You\'re using ${haxeVer}, whilst the required version is 4.2.5 or newer.', + 'The engine may not compile with your current version of Haxe.', + 'We recommend upgrading to 4.2.5 or newer' + ].join("\n")); + break; } } }