mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
Improve clear_version_cache
This commit is contained in:
parent
107f945a23
commit
317567b77a
4 changed files with 17 additions and 4 deletions
|
@ -5,11 +5,10 @@ import lib.code.utils
|
|||
import lib.download
|
||||
import lib.extract
|
||||
import lib.utils
|
||||
import sys
|
||||
import os
|
||||
|
||||
version_id = lib.code.version.get_version_id()
|
||||
|
||||
|
||||
lib.extract.get_generator_mod_data(version_id, 'blockCollisionShapes')
|
||||
|
||||
# lib.download.get_burger()
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -18,9 +18,11 @@ def to_camel_case(name: str):
|
|||
s = f'_{s}'
|
||||
return s
|
||||
|
||||
|
||||
def upper_first_letter(name: str):
|
||||
return name[0].upper() + name[1:]
|
||||
|
||||
|
||||
def padded_hex(n: int):
|
||||
return f'0x{n:02x}'
|
||||
|
||||
|
@ -55,4 +57,4 @@ def group_packets(packets: list[PacketIdentifier]):
|
|||
|
||||
|
||||
def get_dir_location(name: str):
|
||||
return os.path.join(os.path.dirname(__file__), '..', name)
|
||||
return os.path.join(os.path.dirname(os.path.dirname(__file__)), name)
|
||||
|
|
|
@ -6,7 +6,8 @@ import lib.code.packet
|
|||
import lib.download
|
||||
import lib.extract
|
||||
import sys
|
||||
import os
|
||||
|
||||
lib.download.clear_version_cache()
|
||||
|
||||
old_version_id = lib.code.version.get_version_id()
|
||||
old_mappings = lib.download.get_mappings_for_version(old_version_id)
|
||||
|
|
Loading…
Add table
Reference in a new issue