From 317567b77a9e339b5dc9a4832b1ce4c6b045dfe7 Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 21 Jun 2022 19:05:44 -0500 Subject: Improve clear_version_cache --- codegen/lib/download.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'codegen/lib/download.py') diff --git a/codegen/lib/download.py b/codegen/lib/download.py index fbc4f749..e9712f8d 100644 --- a/codegen/lib/download.py +++ b/codegen/lib/download.py @@ -5,7 +5,9 @@ import json import os # make sure the downloads directory exists +print('Making downloads') if not os.path.exists(get_dir_location('downloads')): + print('Made downloads directory.', get_dir_location('downloads')) os.mkdir(get_dir_location('downloads')) @@ -117,7 +119,16 @@ def get_yarn_data(version_id: str): def clear_version_cache(): + print('\033[92mClearing version cache...\033[m') files = [ 'version_manifest.json', 'yarn_versions.json' ] + for file in files: + if os.path.exists(get_dir_location(f'downloads/{file}')): + os.remove(get_dir_location(f'downloads/{file}')) + + os.system( + f'cd {get_dir_location("downloads/Burger")} && git pull') + os.system( + f'cd {get_dir_location("downloads/minecraft-data-generator-server")} && git pull') -- cgit v1.2.3