diff --git a/bypass_token_limit.py b/bypass_token_limit.py index d983394..dd04517 100644 --- a/bypass_token_limit.py +++ b/bypass_token_limit.py @@ -83,10 +83,14 @@ def get_workbench_cursor_path(translator=None) -> str: base_path = config.get('WindowsPaths', 'cursor_path') elif system == "Darwin": base_path = paths_map[system]["base"] + if config.has_section('MacPaths') and config.has_option('MacPaths', 'cursor_path'): + base_path = config.get('MacPaths', 'cursor_path') else: # Linux # For Linux, we've already checked all bases in the loop above # If we're here, it means none of the bases worked, so we'll use the first one base_path = paths_map[system]["bases"][0] + if config.has_section('LinuxPaths') and config.has_option('LinuxPaths', 'cursor_path'): + base_path = config.get('LinuxPaths', 'cursor_path') main_path = os.path.join(base_path, paths_map[system]["main"]) diff --git a/reset_machine_manual.py b/reset_machine_manual.py index 7125b4f..e581c75 100644 --- a/reset_machine_manual.py +++ b/reset_machine_manual.py @@ -236,10 +236,14 @@ def get_workbench_cursor_path(translator=None) -> str: base_path = config.get('WindowsPaths', 'cursor_path') elif system == "Darwin": base_path = paths_map[system]["base"] + if config.has_section('MacPaths') and config.has_option('MacPaths', 'cursor_path'): + base_path = config.get('MacPaths', 'cursor_path') else: # Linux # For Linux, we've already checked all bases in the loop above # If we're here, it means none of the bases worked, so we'll use the first one base_path = paths_map[system]["bases"][0] + if config.has_section('LinuxPaths') and config.has_option('LinuxPaths', 'cursor_path'): + base_path = config.get('LinuxPaths', 'cursor_path') main_path = os.path.join(base_path, paths_map[system]["main"]) diff --git a/totally_reset_cursor.py b/totally_reset_cursor.py index fa724a2..6f319dc 100644 --- a/totally_reset_cursor.py +++ b/totally_reset_cursor.py @@ -232,9 +232,16 @@ def get_workbench_cursor_path(translator=None) -> str: if system == "Windows": base_path = config.get('WindowsPaths', 'cursor_path') - else: + elif system == "Darwin": base_path = paths_map[system]["base"] - main_path = os.path.join(base_path, paths_map[system]["main"]) + if config.has_section('MacPaths') and config.has_option('MacPaths', 'cursor_path'): + base_path = config.get('MacPaths', 'cursor_path') + else: # Linux + # For Linux, we've already checked all bases in the loop above + # If we're here, it means none of the bases worked, so we'll use the first one + base_path = paths_map[system]["bases"][0] + if config.has_section('LinuxPaths') and config.has_option('LinuxPaths', 'cursor_path'): + base_path = config.get('LinuxPaths', 'cursor_path') if not os.path.exists(main_path): raise OSError(translator.get('reset.file_not_found', path=main_path) if translator else f"未找到 Cursor main.js 文件: {main_path}")