mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-24 12:00:15 +10:00
utilities.py: Verify host space before downloading
This commit is contained in:
@@ -400,6 +400,11 @@ def download_file(link, location, is_gui=None, verify_checksum=False):
|
|||||||
if total_file_size > 1024:
|
if total_file_size > 1024:
|
||||||
file_size_rounded = round(total_file_size / 1024 / 1024, 2)
|
file_size_rounded = round(total_file_size / 1024 / 1024, 2)
|
||||||
file_size_string = f" of {file_size_rounded}MB"
|
file_size_string = f" of {file_size_rounded}MB"
|
||||||
|
|
||||||
|
# Check if we have enough space
|
||||||
|
if total_file_size > get_free_space():
|
||||||
|
print(f"Not enough space to download {base_name} ({file_size_rounded}MB)")
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
file_size_string = ""
|
file_size_string = ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user