Skip to content

Commit

Permalink
Não atualiza se já estiver na última versão
Browse files Browse the repository at this point in the history
  • Loading branch information
GuiBrandt committed Feb 19, 2019
1 parent 84d82e5 commit f0538c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions god/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ def check_updates():

cli.info("Encontrado: " + latest_release['tag_name'])

with open(".version", "r") as version_file:
if latest_release['tag_name'] == version_file.readline().strip():
cli.success("O god está atualizado.")
return

while True:
answer = input("\tAtualizar? [Y/n] ").lower().strip()
if answer in ['y', '', 'n']:
Expand Down Expand Up @@ -88,5 +93,8 @@ def check_updates():
copyfile(f, f".update/{path}/{os.path.basename(f)}")
cli.success("OK")

with open(".version", "w") as version_file:
version_file.write(latest_release['tag_name'])

os.system("start python apply_update.py")
sys.exit(0)

0 comments on commit f0538c8

Please sign in to comment.