Skip to content

Commit 6175dea

Browse files
Preserve PATH when run-prod-clerk-local re-execs sudo (#22)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 0be0902 commit 6175dea

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

frontend/run-prod-clerk-local.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ fi
3535

3636
if [[ "${PORT}" -lt 1024 && "${EUID}" -ne 0 ]]; then
3737
echo "Port ${PORT} requires elevated privileges. Re-running with sudo..."
38-
exec sudo -E SUBDOMAIN="${SUBDOMAIN}" PORT="${PORT}" "$0" "$@"
38+
# Keep user PATH so pnpm/nvm shims stay available after sudo re-exec.
39+
exec sudo -E env "PATH=${PATH}" SUBDOMAIN="${SUBDOMAIN}" PORT="${PORT}" "$0" "$@"
3940
fi
4041

4142
if ! grep -Eq "^[[:space:]]*127\.0\.0\.1[[:space:]]+${SUBDOMAIN}([[:space:]]|$)" /etc/hosts; then

0 commit comments

Comments
 (0)