mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2025-06-08 12:32:06 +08:00
Compare commits
No commits in common. "master" and "v0.0.160" have entirely different histories.
@ -15,8 +15,8 @@
|
||||
> ⚠️ **IMPORTANT NOTICE**
|
||||
>
|
||||
> This tool currently supports:
|
||||
> - ✅ Windows: Latest 0.50.x versions (Supported)
|
||||
> - ✅ Mac/Linux: Latest 0.50.x versions (Supported, feedback welcome)
|
||||
> - ✅ Windows: Latest 0.49.x versions (Supported)
|
||||
> - ✅ Mac/Linux: Latest 0.49.x versions (Supported, feedback welcome)
|
||||
>
|
||||
> Please check your Cursor version before using this tool.
|
||||
|
||||
|
@ -15,8 +15,8 @@
|
||||
> ⚠️ **重要提示**
|
||||
>
|
||||
> 本工具当前支持版本:
|
||||
> - ✅ Windows: 最新的 0.50.x 版本(已支持)
|
||||
> - ✅ Mac/Linux: 最新的 0.50.x 版本(已支持,欢迎测试并反馈问题)
|
||||
> - ✅ Windows: 最新的 0.49.x 版本(已支持)
|
||||
> - ✅ Mac/Linux: 最新的 0.49.x 版本(已支持,欢迎测试并反馈问题)
|
||||
|
||||
> 使用前请确认您的 Cursor 版本。
|
||||
|
||||
|
@ -15,8 +15,8 @@
|
||||
> ⚠️ **重要なお知らせ**
|
||||
>
|
||||
> このツールは現在以下のバージョンをサポートしています:
|
||||
> - ✅ Windows: 最新の0.50.xバージョン(サポート済み)
|
||||
> - ✅ Mac/Linux: 最新の0.50.xバージョン(サポート済み、フィードバック歓迎)
|
||||
> - ✅ Windows: 最新の0.49.xバージョン(サポート済み)
|
||||
> - ✅ Mac/Linux: 最新の0.49.xバージョン(サポート済み、フィードバック歓迎)
|
||||
>
|
||||
> このツールを使用する前に、Cursorのバージョンを確認してください。
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
AppImage instructions:
|
||||
mkdir -p ~/Downloads/Cursor
|
||||
cd ~/Downloads/Cursor
|
||||
cd Cursor && ./Cursor-0.50.5-x86_64.AppImage --appimage-extract
|
||||
cd Cursor && ./Cursor-0.49.5-x86_64.AppImage --appimage-extract
|
||||
mkdir -p ~/.local
|
||||
rsync -rt ~/Downloads/Cursor/squashfs-root/usr/ ~/.local
|
||||
# ^ copy the subfolders not usr itself, so the resulting executable should be ~/.local/bin/cursor
|
||||
|
@ -202,7 +202,7 @@ install_cursor_appimage() {
|
||||
if ! find_appimage; then
|
||||
log_warn "在 '$APPIMAGE_SEARCH_DIR' 目录下未找到 '$APPIMAGE_PATTERN' 文件。"
|
||||
# --- 新增:添加文件名格式提醒 ---
|
||||
log_info "请确保 AppImage 文件名格式类似: Cursor-版本号-架构.AppImage (例如: Cursor-0.50.6-aarch64.AppImage 或 Cursor-x.y.z-x86_64.AppImage)"
|
||||
log_info "请确保 AppImage 文件名格式类似: Cursor-版本号-架构.AppImage (例如: Cursor-0.49.6-aarch64.AppImage 或 Cursor-x.y.z-x86_64.AppImage)"
|
||||
# --- 结束:添加文件名格式提醒 ---
|
||||
# 等待用户放置文件
|
||||
read -p $"请将 Cursor AppImage 文件放入 '$APPIMAGE_SEARCH_DIR' 目录,然后按 Enter 键继续..."
|
||||
@ -1084,67 +1084,6 @@ select_menu_option() {
|
||||
done
|
||||
}
|
||||
|
||||
# 新增 Cursor 初始化清理函数
|
||||
cursor_initialize_cleanup() {
|
||||
log_info "正在执行 Cursor 初始化清理..."
|
||||
# CURSOR_CONFIG_DIR 在脚本全局已定义: $HOME/.config/Cursor
|
||||
local USER_CONFIG_BASE_PATH="$CURSOR_CONFIG_DIR/User"
|
||||
|
||||
log_debug "用户配置基础路径: $USER_CONFIG_BASE_PATH"
|
||||
|
||||
local files_to_delete=(
|
||||
"$USER_CONFIG_BASE_PATH/globalStorage/state.vscdb"
|
||||
"$USER_CONFIG_BASE_PATH/globalStorage/state.vscdb.backup"
|
||||
)
|
||||
|
||||
local folder_to_clean_contents="$USER_CONFIG_BASE_PATH/History"
|
||||
local folder_to_delete_completely="$USER_CONFIG_BASE_PATH/workspaceStorage"
|
||||
|
||||
# 删除指定文件
|
||||
for file_path in "${files_to_delete[@]}"; do
|
||||
log_debug "检查文件: $file_path"
|
||||
if [ -f "$file_path" ]; then
|
||||
if rm -f "$file_path"; then
|
||||
log_info "已删除文件: $file_path"
|
||||
else
|
||||
log_error "删除文件 $file_path 失败"
|
||||
fi
|
||||
else
|
||||
log_warn "文件不存在,跳过删除: $file_path"
|
||||
fi
|
||||
done
|
||||
|
||||
# 清空指定文件夹内容
|
||||
log_debug "检查待清空文件夹: $folder_to_clean_contents"
|
||||
if [ -d "$folder_to_clean_contents" ]; then
|
||||
if find "$folder_to_clean_contents" -mindepth 1 -delete; then
|
||||
log_info "已清空文件夹内容: $folder_to_clean_contents"
|
||||
else
|
||||
if [ -z "$(ls -A "$folder_to_clean_contents")" ]; then
|
||||
log_info "文件夹 $folder_to_clean_contents 现在为空。"
|
||||
else
|
||||
log_error "清空文件夹 $folder_to_clean_contents 内容失败 (部分或全部)。请检查权限或手动删除。"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
log_warn "文件夹不存在,跳过清空: $folder_to_clean_contents"
|
||||
fi
|
||||
|
||||
# 删除指定文件夹及其内容
|
||||
log_debug "检查待删除文件夹: $folder_to_delete_completely"
|
||||
if [ -d "$folder_to_delete_completely" ]; then
|
||||
if rm -rf "$folder_to_delete_completely"; then
|
||||
log_info "已删除文件夹: $folder_to_delete_completely"
|
||||
else
|
||||
log_error "删除文件夹 $folder_to_delete_completely 失败"
|
||||
fi
|
||||
else
|
||||
log_warn "文件夹不存在,跳过删除: $folder_to_delete_completely"
|
||||
fi
|
||||
|
||||
log_info "Cursor 初始化清理完成。"
|
||||
}
|
||||
|
||||
# 主函数
|
||||
main() {
|
||||
# 初始化日志文件
|
||||
@ -1170,13 +1109,9 @@ main() {
|
||||
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝
|
||||
"
|
||||
echo -e "${BLUE}=====================================================${NC}"
|
||||
echo -e "${GREEN} Cursor Linux 启动与修改工具(免费) ${NC}"
|
||||
echo -e "${YELLOW} 关注公众号【煎饼果子卷AI】 ${NC}"
|
||||
echo -e "${YELLOW} 一起交流更多Cursor技巧和AI知识(脚本免费、关注公众号加群有更多技巧和大佬) ${NC}"
|
||||
echo -e "${GREEN} Cursor Linux 启动与修改工具 ${NC}"
|
||||
echo -e "${BLUE}=====================================================${NC}"
|
||||
echo
|
||||
echo -e "${GREEN} [小小广告] 出售CursorPro教育号一年质保三个月,有需要找我(86),WeChat:JavaRookie666 ${NC}"
|
||||
echo
|
||||
echo -e "${YELLOW}[提示]${NC} 本工具旨在修改 Cursor 以解决可能的启动问题或设备限制。"
|
||||
echo -e "${YELLOW}[提示]${NC} 它将优先修改 JS 文件,并可选择重置设备ID和禁用自动更新。"
|
||||
echo -e "${YELLOW}[提示]${NC} 如果未找到 Cursor,将尝试从 '$APPIMAGE_SEARCH_DIR' 目录安装。"
|
||||
@ -1221,9 +1156,6 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 执行 Cursor 初始化清理
|
||||
# cursor_initialize_cleanup
|
||||
|
||||
# 备份并处理配置文件 (机器码重置选项)
|
||||
if ! generate_new_config; then
|
||||
log_error "处理配置文件时出错,脚本中止。"
|
||||
|
@ -50,66 +50,6 @@ log_cmd_output() {
|
||||
echo "" >> "$LOG_FILE"
|
||||
}
|
||||
|
||||
# 新增 Cursor 初始化清理函数
|
||||
cursor_initialize_cleanup() {
|
||||
log_info "正在执行 Cursor 初始化清理..."
|
||||
local BASE_PATH="$HOME/Library/Application Support/Cursor/User"
|
||||
|
||||
log_debug "基础路径: $BASE_PATH"
|
||||
|
||||
local files_to_delete=(
|
||||
"$BASE_PATH/globalStorage/state.vscdb"
|
||||
"$BASE_PATH/globalStorage/state.vscdb.backup"
|
||||
)
|
||||
|
||||
local folder_to_clean_contents="$BASE_PATH/History"
|
||||
local folder_to_delete_completely="$BASE_PATH/workspaceStorage"
|
||||
|
||||
# 删除指定文件
|
||||
for file_path in "${files_to_delete[@]}"; do
|
||||
log_debug "检查文件: $file_path"
|
||||
if [ -f "$file_path" ]; then
|
||||
if rm -f "$file_path"; then
|
||||
log_info "已删除文件: $file_path"
|
||||
else
|
||||
log_error "删除文件 $file_path 失败"
|
||||
fi
|
||||
else
|
||||
log_warn "文件不存在,跳过删除: $file_path"
|
||||
fi
|
||||
done
|
||||
|
||||
# 清空指定文件夹内容
|
||||
log_debug "检查待清空文件夹: $folder_to_clean_contents"
|
||||
if [ -d "$folder_to_clean_contents" ]; then
|
||||
if find "$folder_to_clean_contents" -mindepth 1 -delete; then
|
||||
log_info "已清空文件夹内容: $folder_to_clean_contents"
|
||||
else
|
||||
if [ -z "$(ls -A "$folder_to_clean_contents")" ]; then
|
||||
log_info "文件夹 $folder_to_clean_contents 现在为空。" # 通常find成功即代表操作完成
|
||||
else
|
||||
log_error "清空文件夹 $folder_to_clean_contents 内容失败 (部分或全部)。请检查权限或手动删除。"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
log_warn "文件夹不存在,跳过清空: $folder_to_clean_contents"
|
||||
fi
|
||||
|
||||
# 删除指定文件夹及其内容
|
||||
log_debug "检查待删除文件夹: $folder_to_delete_completely"
|
||||
if [ -d "$folder_to_delete_completely" ]; then
|
||||
if rm -rf "$folder_to_delete_completely"; then
|
||||
log_info "已删除文件夹: $folder_to_delete_completely"
|
||||
else
|
||||
log_error "删除文件夹 $folder_to_delete_completely 失败"
|
||||
fi
|
||||
else
|
||||
log_warn "文件夹不存在,跳过删除: $folder_to_delete_completely"
|
||||
fi
|
||||
|
||||
log_info "Cursor 初始化清理完成。"
|
||||
}
|
||||
|
||||
# 获取当前用户
|
||||
get_current_user() {
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
@ -1291,8 +1231,6 @@ main() {
|
||||
echo -e "${YELLOW} 一起交流更多Cursor技巧和AI知识(脚本免费、关注公众号加群有更多技巧和大佬) ${NC}"
|
||||
echo -e "${BLUE}================================${NC}"
|
||||
echo
|
||||
echo -e "${YELLOW} [小小广告] 出售CursorPro教育号一年质保三个月,有需要找我(86),WeChat:JavaRookie666 ${NC}"
|
||||
echo
|
||||
echo -e "${YELLOW}[重要提示]${NC} 本工具默认会修改系统 MAC 地址 (临时) 并修改 JS 文件以重置设备标识。"
|
||||
echo -e "${YELLOW}[重要提示]${NC} 本工具免费,如果对您有帮助,请关注公众号【煎饼果子卷AI】"
|
||||
echo
|
||||
@ -1300,10 +1238,6 @@ main() {
|
||||
# 执行主要功能
|
||||
check_permissions
|
||||
check_and_kill_cursor
|
||||
|
||||
# 执行 Cursor 初始化清理
|
||||
# cursor_initialize_cleanup
|
||||
|
||||
backup_config
|
||||
|
||||
# 新增:默认执行系统 MAC 地址修改
|
||||
|
@ -108,9 +108,8 @@ Write-Host "$GREEN Cursor 设备ID 修改工具 $NC"
|
||||
Write-Host "$YELLOW 关注公众号【煎饼果子卷AI】 $NC"
|
||||
Write-Host "$YELLOW 一起交流更多Cursor技巧和AI知识(脚本免费、关注公众号加群有更多技巧和大佬) $NC"
|
||||
Write-Host "$YELLOW [重要提示] 本工具免费,如果对您有帮助,请关注公众号【煎饼果子卷AI】 $NC"
|
||||
Write-Host ""
|
||||
Write-Host "$YELLOW [小小广告] 出售CursorPro教育号一年质保三个月,有需要找我(86),WeChat:JavaRookie666 $NC"
|
||||
Write-Host "$BLUE================================$NC"
|
||||
Write-Host ""
|
||||
|
||||
# 获取并显示 Cursor 版本
|
||||
function Get-CursorVersion {
|
||||
@ -150,7 +149,7 @@ function Get-CursorVersion {
|
||||
$cursorVersion = Get-CursorVersion
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "$YELLOW[重要提示]$NC 最新的 0.50.x (以支持)"
|
||||
Write-Host "$YELLOW[重要提示]$NC 最新的 0.49.x (以支持)"
|
||||
Write-Host ""
|
||||
|
||||
# 检查并关闭 Cursor 进程
|
||||
@ -205,7 +204,7 @@ Close-CursorProcess "Cursor"
|
||||
Close-CursorProcess "cursor"
|
||||
|
||||
# 执行 Cursor 初始化清理
|
||||
# Cursor-初始化
|
||||
Cursor-初始化
|
||||
|
||||
# 创建备份目录
|
||||
if (-not (Test-Path $BACKUP_DIR)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user