diff --git a/py/init.py b/py/init.py index 2122ebf..e0bf815 100644 --- a/py/init.py +++ b/py/init.py @@ -1,2 +1,5 @@ -from version import version -print(version()) +import version +if version.local() < version.remote(): + print("needs update") +else: + print("is fine") diff --git a/py/version.py b/py/version.py new file mode 100644 index 0000000..e51fbfb --- /dev/null +++ b/py/version.py @@ -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() \ No newline at end of file