fix: unexpected version update.

This commit is contained in:
EstrellaXD
2023-08-30 01:24:27 +08:00
parent e5af3d9924
commit de5bf3fd61

View File

@@ -3,9 +3,10 @@ from module.conf import VERSION
def version_check() -> bool:
with open("config/version.txt", "rw") as f:
version = f.read()
if VERSION > version:
f.write(VERSION)
# Read last version
versions = f.readlines()
if VERSION[:3] > versions[-1][:3]:
f.write(VERSION[:3] + "\n")
return False
else:
return True