mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 16:40:05 +01:00
Merge pull request #943 from bramus/patch-valet-share-vscode-fix
Pass USER as envvar when relaunching valet using sudo. Fixes #904
This commit is contained in:
4
valet
4
valet
@@ -22,7 +22,7 @@ fi
|
|||||||
|
|
||||||
if [[ "$EUID" -ne 0 ]]
|
if [[ "$EUID" -ne 0 ]]
|
||||||
then
|
then
|
||||||
sudo --preserve-env "$SOURCE" "$@"
|
sudo USER="$USER" --preserve-env "$SOURCE" "$@"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ then
|
|||||||
# Fetch Ngrok URL In Background...
|
# Fetch Ngrok URL In Background...
|
||||||
bash "$DIR/cli/scripts/fetch-share-url.sh" "$HOST" &
|
bash "$DIR/cli/scripts/fetch-share-url.sh" "$HOST" &
|
||||||
|
|
||||||
sudo -u "$(logname)" "$DIR/bin/ngrok" http "$HOST.$TLD:$PORT" -host-header=rewrite $PARAMS
|
sudo -u "$USER" "$DIR/bin/ngrok" http "$HOST.$TLD:$PORT" -host-header=rewrite $PARAMS
|
||||||
exit
|
exit
|
||||||
|
|
||||||
# Finally, for every other command we will just proxy into the PHP tool
|
# Finally, for every other command we will just proxy into the PHP tool
|
||||||
|
|||||||
Reference in New Issue
Block a user