Skip to content

Commit 1c10750

Browse files
authored
Merge pull request #708 from DaydreamCoding/patch-for-cursor_path
fix use cursor_path
2 parents 5aa8dbb + 4a53343 commit 1c10750

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

bypass_token_limit.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,14 @@ def get_workbench_cursor_path(translator=None) -> str:
8383
base_path = config.get('WindowsPaths', 'cursor_path')
8484
elif system == "Darwin":
8585
base_path = paths_map[system]["base"]
86+
if config.has_section('MacPaths') and config.has_option('MacPaths', 'cursor_path'):
87+
base_path = config.get('MacPaths', 'cursor_path')
8688
else: # Linux
8789
# For Linux, we've already checked all bases in the loop above
8890
# If we're here, it means none of the bases worked, so we'll use the first one
8991
base_path = paths_map[system]["bases"][0]
92+
if config.has_section('LinuxPaths') and config.has_option('LinuxPaths', 'cursor_path'):
93+
base_path = config.get('LinuxPaths', 'cursor_path')
9094

9195
main_path = os.path.join(base_path, paths_map[system]["main"])
9296

reset_machine_manual.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,14 @@ def get_workbench_cursor_path(translator=None) -> str:
236236
base_path = config.get('WindowsPaths', 'cursor_path')
237237
elif system == "Darwin":
238238
base_path = paths_map[system]["base"]
239+
if config.has_section('MacPaths') and config.has_option('MacPaths', 'cursor_path'):
240+
base_path = config.get('MacPaths', 'cursor_path')
239241
else: # Linux
240242
# For Linux, we've already checked all bases in the loop above
241243
# If we're here, it means none of the bases worked, so we'll use the first one
242244
base_path = paths_map[system]["bases"][0]
245+
if config.has_section('LinuxPaths') and config.has_option('LinuxPaths', 'cursor_path'):
246+
base_path = config.get('LinuxPaths', 'cursor_path')
243247

244248
main_path = os.path.join(base_path, paths_map[system]["main"])
245249

totally_reset_cursor.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,16 @@ def get_workbench_cursor_path(translator=None) -> str:
232232

233233
if system == "Windows":
234234
base_path = config.get('WindowsPaths', 'cursor_path')
235-
else:
235+
elif system == "Darwin":
236236
base_path = paths_map[system]["base"]
237-
main_path = os.path.join(base_path, paths_map[system]["main"])
237+
if config.has_section('MacPaths') and config.has_option('MacPaths', 'cursor_path'):
238+
base_path = config.get('MacPaths', 'cursor_path')
239+
else: # Linux
240+
# For Linux, we've already checked all bases in the loop above
241+
# If we're here, it means none of the bases worked, so we'll use the first one
242+
base_path = paths_map[system]["bases"][0]
243+
if config.has_section('LinuxPaths') and config.has_option('LinuxPaths', 'cursor_path'):
244+
base_path = config.get('LinuxPaths', 'cursor_path')
238245

239246
if not os.path.exists(main_path):
240247
raise OSError(translator.get('reset.file_not_found', path=main_path) if translator else f"未找到 Cursor main.js 文件: {main_path}")

0 commit comments

Comments
 (0)