Add better CLI error handling

This commit is contained in:
Mykola Grymalyuk
2022-05-18 20:11:14 -06:00
parent c8a70764b8
commit 23119dedc9
4 changed files with 4 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
- Applicable for BCM2046 and BCM2070 chipsets
- Fix backported to 0.4.5 release
- GUI Enhancements:
- Greatly speed up GUI load times (300-800% on average)
- Greatly improve GUI load times (300-800% on average)
## 0.4.5
- Fix AutoPatcher.pkg download on releases

View File

@@ -107,6 +107,7 @@ class Constants:
self.ignore_updates = False # Ignore OCLP updates
self.wxpython_variant = False # Determine if using wxPython variant
self.unpack_thread = None # Determine if unpack thread finished
self.cli_mode = False # Determine if running in CLI mode
## Hardware
self.computer: device_probe.Computer = None # type: ignore

View File

@@ -53,6 +53,7 @@ class OpenCoreLegacyPatcher:
ignore_args = ["--auto_patch", "--gui_patch", "--gui_unpatch"]
if not any(x in sys.argv for x in ignore_args):
self.constants.current_path = Path.cwd()
self.constants.cli_mode = True
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
print("- Rerouting payloads location")
self.constants.payload_path = sys._MEIPASS / Path("payloads")

View File

@@ -309,7 +309,7 @@ class PatchSysVolume:
return output
def download_files(self):
if self.constants.gui_mode is False or "Library/InstallerSandboxes/" in str(self.constants.payload_path):
if self.constants.cli_mode is True:
download_result, link = sys_patch_download.grab_patcher_support_pkg(self.constants).download_files()
else:
download_result = True