mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2025-06-08 12:32:06 +08:00
Merge pull request #299 from abdibaker/fix-sudo-home-path
fix: correctly identify storage file path when run with sudo
This commit is contained in:
commit
f05ab67262
@ -43,8 +43,13 @@ if [ -z "$CURRENT_USER" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 定义配置文件路径
|
# 定义配置文件路径
|
||||||
STORAGE_FILE="$HOME/.config/Cursor/User/globalStorage/storage.json"
|
if [ "$EUID" -eq 0 ] && [ -n "$SUDO_USER" ]; then
|
||||||
BACKUP_DIR="$HOME/.config/Cursor/User/globalStorage/backups"
|
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() {
|
check_permissions() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user