소스 검색

fix: resolve INSTALL_DIR to real user home when run with sudo

$HOME resolves to /root under sudo, causing permission denied errors
when the script tries to create the venv as the non-root user.
Use ~$SUDO_USER to always resolve the invoking user's home directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tuanchris 4 달 전
부모
커밋
56f775f2f1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      setup-pi.sh

+ 1 - 1
setup-pi.sh

@@ -28,7 +28,7 @@ NC='\033[0m' # No Color
 # Default options
 FIX_WIFI=true  # Applied by default for stability
 SETUP_HOTSPOT=true  # Autohotspot for first-time WiFi setup
-INSTALL_DIR="$HOME/dune-weaver"
+INSTALL_DIR="$(eval echo ~"${SUDO_USER:-$USER}")/dune-weaver"
 REPO_URL="https://github.com/tuanchris/dune-weaver"
 
 # Parse arguments