diff options
| author | mat <github@matdoes.dev> | 2022-06-21 19:05:44 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-21 19:05:44 -0500 |
| commit | 317567b77a9e339b5dc9a4832b1ce4c6b045dfe7 (patch) | |
| tree | 4e49f9123e0f41ee7a066b430d574d0b7c7dc458 /codegen/lib/download.py | |
| parent | 107f945a2383cb0f9ba8de458c7764e0afff026a (diff) | |
| download | azalea-drasl-317567b77a9e339b5dc9a4832b1ce4c6b045dfe7.tar.xz | |
Improve clear_version_cache
Diffstat (limited to 'codegen/lib/download.py')
| -rw-r--r-- | codegen/lib/download.py | 11 |
1 files changed, 11 insertions, 0 deletions
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') |
