mirror of
https://github.com/yeongpin/cursor-free-vip.git
synced 2025-08-03 21:17:35 +08:00
Merge branch 'yeongpin:main' into main
This commit is contained in:
commit
51fcf83ebb
@ -1,5 +1,11 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## v1.7.18
|
||||||
|
1. Fix: No Write Permission | 修復沒有寫入權限
|
||||||
|
2. Fix: Improve Linux path detection and config handling | 修正 linux 路徑和config寫入讀取
|
||||||
|
3. Fix: Locale path_no_exist missing | 修正 path_no_exist 語言遺失
|
||||||
|
4. Fix: Some Issues | 修復一些問題
|
||||||
|
|
||||||
## v1.7.17
|
## v1.7.17
|
||||||
1. Fix: Remove 10 options Totally Reset Cursor | 修復完全重置 Cursor 選項
|
1. Fix: Remove 10 options Totally Reset Cursor | 修復完全重置 Cursor 選項
|
||||||
|
|
||||||
|
@ -103,8 +103,9 @@
|
|||||||
"package_not_found": "Package.json Not Found: {path}",
|
"package_not_found": "Package.json Not Found: {path}",
|
||||||
"check_version_failed": "Check Version Failed: {error}",
|
"check_version_failed": "Check Version Failed: {error}",
|
||||||
"stack_trace": "Stack Trace",
|
"stack_trace": "Stack Trace",
|
||||||
"version_too_low": "Cursor Version Too Low: {version} < 0.45.0"
|
"version_too_low": "Cursor Version Too Low: {version} < 0.45.0",
|
||||||
|
"no_write_permission": "No Write Permission: {path}",
|
||||||
|
"path_not_found": "Path Not Found: {path}"
|
||||||
},
|
},
|
||||||
"register": {
|
"register": {
|
||||||
"title": "Cursor Registration Tool",
|
"title": "Cursor Registration Tool",
|
||||||
|
@ -103,7 +103,9 @@
|
|||||||
"package_not_found": "package.json未找到: {path}",
|
"package_not_found": "package.json未找到: {path}",
|
||||||
"check_version_failed": "检查版本失败: {error}",
|
"check_version_failed": "检查版本失败: {error}",
|
||||||
"stack_trace": "堆栈跟踪",
|
"stack_trace": "堆栈跟踪",
|
||||||
"version_too_low": "Cursor版本太低: {version} < 0.45.0"
|
"version_too_low": "Cursor版本太低: {version} < 0.45.0",
|
||||||
|
"no_write_permission": "没有写入权限: {path}",
|
||||||
|
"path_not_found": "路径未找到: {path}"
|
||||||
},
|
},
|
||||||
"register": {
|
"register": {
|
||||||
"title": "Cursor 注册工具",
|
"title": "Cursor 注册工具",
|
||||||
|
@ -101,7 +101,9 @@
|
|||||||
"package_not_found": "package.json未找到: {path}",
|
"package_not_found": "package.json未找到: {path}",
|
||||||
"check_version_failed": "檢查版本失敗: {error}",
|
"check_version_failed": "檢查版本失敗: {error}",
|
||||||
"stack_trace": "堆疊跟踪",
|
"stack_trace": "堆疊跟踪",
|
||||||
"version_too_low": "Cursor版本太低: {version} < 0.45.0"
|
"version_too_low": "Cursor版本太低: {version} < 0.45.0",
|
||||||
|
"no_write_permission": "沒有寫入權限: {path}",
|
||||||
|
"path_not_found": "路徑未找到: {path}"
|
||||||
},
|
},
|
||||||
|
|
||||||
"register": {
|
"register": {
|
||||||
|
2
logo.py
2
logo.py
@ -83,7 +83,7 @@ muhammedfurkan plamkatawe
|
|||||||
"""
|
"""
|
||||||
OTHER_INFO_TEXT = f"""{Fore.YELLOW}
|
OTHER_INFO_TEXT = f"""{Fore.YELLOW}
|
||||||
Github: https://github.com/yeongpin/cursor-free-vip{Fore.RED}
|
Github: https://github.com/yeongpin/cursor-free-vip{Fore.RED}
|
||||||
Press 7 to change language | 按下 7 键切换语言{Style.RESET_ALL}"""
|
Press 8 to change language | 按下 8 键切换语言{Style.RESET_ALL}"""
|
||||||
|
|
||||||
# center display LOGO and DESCRIPTION
|
# center display LOGO and DESCRIPTION
|
||||||
CURSOR_LOGO = center_multiline_text(LOGO_TEXT, handle_chinese=False)
|
CURSOR_LOGO = center_multiline_text(LOGO_TEXT, handle_chinese=False)
|
||||||
|
@ -37,10 +37,41 @@ def get_cursor_paths(translator=None) -> Tuple[str, str]:
|
|||||||
config_dir = os.path.join(get_user_documents_path(), ".cursor-free-vip")
|
config_dir = os.path.join(get_user_documents_path(), ".cursor-free-vip")
|
||||||
config_file = os.path.join(config_dir, "config.ini")
|
config_file = os.path.join(config_dir, "config.ini")
|
||||||
|
|
||||||
if not os.path.exists(config_file):
|
# Create config directory if it doesn't exist
|
||||||
raise OSError(translator.get('reset.config_not_found') if translator else "找不到配置文件")
|
if not os.path.exists(config_dir):
|
||||||
|
os.makedirs(config_dir)
|
||||||
|
|
||||||
config.read(config_file, encoding='utf-8') # Specify encoding
|
# Default paths for different systems
|
||||||
|
default_paths = {
|
||||||
|
"Darwin": "/Applications/Cursor.app/Contents/Resources/app",
|
||||||
|
"Windows": os.path.join(os.getenv("LOCALAPPDATA", ""), "Programs", "Cursor", "resources", "app"),
|
||||||
|
"Linux": ["/opt/Cursor/resources/app", "/usr/share/cursor/resources/app", os.path.expanduser("~/.local/share/cursor/resources/app")]
|
||||||
|
}
|
||||||
|
|
||||||
|
# If config doesn't exist, create it with default paths
|
||||||
|
if not os.path.exists(config_file):
|
||||||
|
for section in ['MacPaths', 'WindowsPaths', 'LinuxPaths']:
|
||||||
|
if not config.has_section(section):
|
||||||
|
config.add_section(section)
|
||||||
|
|
||||||
|
if system == "Darwin":
|
||||||
|
config.set('MacPaths', 'cursor_path', default_paths["Darwin"])
|
||||||
|
elif system == "Windows":
|
||||||
|
config.set('WindowsPaths', 'cursor_path', default_paths["Windows"])
|
||||||
|
elif system == "Linux":
|
||||||
|
# For Linux, try to find the first existing path
|
||||||
|
for path in default_paths["Linux"]:
|
||||||
|
if os.path.exists(path):
|
||||||
|
config.set('LinuxPaths', 'cursor_path', path)
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
# If no path exists, use the first one as default
|
||||||
|
config.set('LinuxPaths', 'cursor_path', default_paths["Linux"][0])
|
||||||
|
|
||||||
|
with open(config_file, 'w', encoding='utf-8') as f:
|
||||||
|
config.write(f)
|
||||||
|
else:
|
||||||
|
config.read(config_file, encoding='utf-8')
|
||||||
|
|
||||||
# Get path based on system
|
# Get path based on system
|
||||||
if system == "Darwin":
|
if system == "Darwin":
|
||||||
@ -57,6 +88,17 @@ def get_cursor_paths(translator=None) -> Tuple[str, str]:
|
|||||||
|
|
||||||
base_path = config.get(section, 'cursor_path')
|
base_path = config.get(section, 'cursor_path')
|
||||||
|
|
||||||
|
# For Linux, try to find the first existing path if the configured one doesn't exist
|
||||||
|
if system == "Linux" and not os.path.exists(base_path):
|
||||||
|
for path in default_paths["Linux"]:
|
||||||
|
if os.path.exists(path):
|
||||||
|
base_path = path
|
||||||
|
# Update config with the found path
|
||||||
|
config.set(section, 'cursor_path', path)
|
||||||
|
with open(config_file, 'w', encoding='utf-8') as f:
|
||||||
|
config.write(f)
|
||||||
|
break
|
||||||
|
|
||||||
if not os.path.exists(base_path):
|
if not os.path.exists(base_path):
|
||||||
raise OSError(translator.get('reset.path_not_found', path=base_path) if translator else f"找不到 Cursor 路徑: {base_path}")
|
raise OSError(translator.get('reset.path_not_found', path=base_path) if translator else f"找不到 Cursor 路徑: {base_path}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user