This commit is contained in:
ionburger 2022-10-29 11:39:40 -06:00
parent 1b44386bb6
commit 74c8099efe
2 changed files with 15 additions and 2 deletions

View File

@ -1,2 +1,5 @@
from version import version
print(version())
import version
if version.local() < version.remote():
print("needs update")
else:
print("is fine")

10
py/version.py Normal file
View File

@ -0,0 +1,10 @@
import subprocess
def remote():
try:
process = subprocess.Popen(["lastversion", "ionburger/turdbot"],stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
return (process.communicate()[0])
except:
return 0
def local():
return open("VERSION","r").read()