From d91b90347a52c8d4ed567c5d2fa7273dfcb3433b Mon Sep 17 00:00:00 2001 From: yeongpin Date: Mon, 13 Jan 2025 13:15:13 +0800 Subject: [PATCH] update sh --- scripts/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index ba78474..2550fc2 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -93,10 +93,10 @@ install_cursor_free_vip() { echo -e "${CYAN}ℹ️ 正在以普通用戶身份啟動程序...${NC}" - # 以普通用户身份运行程序 if [[ "$(uname)" == "Darwin" ]]; then - # macOS - su - $REAL_USER -c "$binary_path" + # macOS: 使用 sudo -u 并保持环境变量 + HOME_DIR=$(eval echo ~$REAL_USER) + sudo -u $REAL_USER HOME=$HOME_DIR "$binary_path" else # Linux su - $REAL_USER -c "$binary_path"