From 3d61fa97539cd3fda4c9b5b201e1f2a784dea231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=85=8E=E9=A5=BC=E6=9E=9C=E5=AD=90=E5=8D=B7=E9=B2=A8?= =?UTF-8?q?=E9=B1=BC=E8=BE=A3=E6=A4=92?= Date: Wed, 5 Feb 2025 11:53:19 +0800 Subject: [PATCH] fix: Improve error messages for Linux and Mac ID modifier scripts - Updated error messages in Linux script to include specific package installation commands - Enhanced Mac script's UUID modification prompt with better formatting and color - Added spacing to improve readability of user prompts --- scripts/run/cursor_linux_id_modifier.sh | 4 ++-- scripts/run/cursor_mac_id_modifier.sh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/run/cursor_linux_id_modifier.sh b/scripts/run/cursor_linux_id_modifier.sh index 1af7430..478b772 100644 --- a/scripts/run/cursor_linux_id_modifier.sh +++ b/scripts/run/cursor_linux_id_modifier.sh @@ -180,12 +180,12 @@ generate_uuid() { generate_new_config() { # 错误处理 if ! command -v xxd &> /dev/null; then - log_error "未找到 xxd 命令,请安装 xxd" + log_error "未找到 xxd 命令,请安装 xxd,使用 apt-get install xxd" exit 1 fi if ! command -v uuidgen &> /dev/null; then - log_error "未找到 uuidgen 命令,请安装 uuidgen" + log_error "未找到 uuidgen 命令,请安装 uuidgen,使用 apt-get install uuid-runtime" exit 1 fi diff --git a/scripts/run/cursor_mac_id_modifier.sh b/scripts/run/cursor_mac_id_modifier.sh index 31e993c..0ced361 100644 --- a/scripts/run/cursor_mac_id_modifier.sh +++ b/scripts/run/cursor_mac_id_modifier.sh @@ -176,8 +176,9 @@ generate_new_config() { local new_system_uuid=$(uuidgen) # 尝试修改系统 UUID (需要用户确认) - log_warn "注意:修改系统 UUID 需要重启系统才能生效" - log_warn "是否要修改系统 UUID?(y/N)" + echo # 添加空行使提示更清晰 + printf "${YELLOW}注意:修改系统 UUID 需要重启系统才能生效${NC}\n" + printf "${YELLOW}是否要修改系统 UUID?(y/N)${NC} " # 使用 printf 并在末尾加空格 read -r choice if [[ "$choice" =~ ^[Yy]$ ]]; then sudo nvram SystemUUID="$new_system_uuid"