mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-19 22:00:00 +10:00
logging_handler.py: Add CLI check
This commit is contained in:
@@ -117,7 +117,7 @@ class Constants:
|
||||
## Internal settings
|
||||
self.allow_oc_everywhere: bool = False # Set whether Patcher can be run on unsupported Macs
|
||||
self.gui_mode: bool = False # Determine whether running in a GUI or TUI
|
||||
self.cli_mode: bool = False # Determine if running in CLI mode
|
||||
self.cli_mode: bool = True # Determine if running in CLI mode
|
||||
self.validate: bool = False # Enable validation testing for CI
|
||||
self.recovery_status: bool = False # Detect if booted into RecoveryOS
|
||||
self.ignore_updates: bool = False # Ignore OCLP updates
|
||||
|
||||
@@ -159,6 +159,9 @@ class InitializeLoggingSupport:
|
||||
"""
|
||||
logging.error("Uncaught exception in main thread", exc_info=(type, value, tb))
|
||||
|
||||
if self.constants.cli_mode is True:
|
||||
return
|
||||
|
||||
error_msg = f"OpenCore Legacy Patcher encountered the following internal error:\n\n"
|
||||
error_msg += f"{type.__name__}: {value}"
|
||||
if tb:
|
||||
|
||||
+1
-1
@@ -93,6 +93,7 @@ class OpenCoreLegacyPatcher:
|
||||
threading.Thread(target=analytics_handler.Analytics, args=(self.constants,)).start()
|
||||
|
||||
if utilities.check_cli_args() is None:
|
||||
self.constants.cli_mode = False
|
||||
logging.info(f"- No arguments present, loading {'GUI' if self.constants.wxpython_variant is True else 'TUI'} mode")
|
||||
return
|
||||
|
||||
@@ -102,7 +103,6 @@ class OpenCoreLegacyPatcher:
|
||||
ignore_args = ["--auto_patch", "--gui_patch", "--gui_unpatch", "--update_installed"]
|
||||
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"):
|
||||
logging.info("- Rerouting payloads location")
|
||||
self.constants.payload_path = sys._MEIPASS / Path("payloads")
|
||||
|
||||
Reference in New Issue
Block a user