Skip to content

Commit

Permalink
add version message and notification when new version available
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceclouds42 committed Mar 24, 2021
1 parent 66c08c8 commit 62b324c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
8 changes: 7 additions & 1 deletion fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,10 @@ def get_kotlin():
def get_kx_ser():
with urlopen(f"https://api.github.com/repos/Kotlin/kotlinx.serialization/releases/latest") as url:
data = json.loads(url.read().decode())
return data["tag_name"][1:]
return data["tag_name"][1:]


def get_latest_of_this():
with urlopen(f"https://api.github.com/repos/SpaceClouds42/FabriKGenerator/releases/latest") as url:
data = json.loads(url.read().decode())
return data["tag_name"][1:]
11 changes: 10 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
from re import sub
from re import search
from string import capwords
from time import sleep

import inputs
import fetcher
import generator


def main():
print("FabriKGenerator, the simplest way to start generate a Fabric Kotlin mod\n")
this_version = "1.0.0"
latest_version = fetcher.get_latest_of_this()
print("FabriKGenerator, the simplest way to start generate a Fabric Kotlin mod")
print(f"Using version {this_version}")
if latest_version != this_version:
print(f"There's a newer version! Download v{latest_version} for the latest features")
sleep(2)

print()

# Inputs
mc = inputs.minecraft_version()
Expand Down

0 comments on commit 62b324c

Please sign in to comment.