Browse Source
fix: correctly identify storage file path when run with sudo
pull/299/head
Abdillah Bakari
3 months ago
No known key found for this signature in database
GPG Key ID: CA2EE03DD0913486
1 changed files with
7 additions and
2 deletions
-
scripts/run/cursor_linux_id_modifier.sh
|
|
@ -43,8 +43,13 @@ if [ -z "$CURRENT_USER" ]; then |
|
|
|
fi |
|
|
|
|
|
|
|
# 定义配置文件路径 |
|
|
|
STORAGE_FILE="$HOME/.config/Cursor/User/globalStorage/storage.json" |
|
|
|
BACKUP_DIR="$HOME/.config/Cursor/User/globalStorage/backups" |
|
|
|
if [ "$EUID" -eq 0 ] && [ -n "$SUDO_USER" ]; then |
|
|
|
USER_HOME=$(eval echo ~$SUDO_USER) |
|
|
|
else |
|
|
|
USER_HOME="$HOME" |
|
|
|
fi |
|
|
|
STORAGE_FILE="$USER_HOME/.config/Cursor/User/globalStorage/storage.json" |
|
|
|
BACKUP_DIR="$USER_HOME/.config/Cursor/User/globalStorage/backups" |
|
|
|
|
|
|
|
# 检查权限 |
|
|
|
check_permissions() { |
|
|
|