1
0
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:
Matt Stauffer
2020-11-18 08:31:30 -05:00
committed by GitHub

4
valet
View File

@@ -22,7 +22,7 @@ fi
if [[ "$EUID" -ne 0 ]]
then
sudo --preserve-env "$SOURCE" "$@"
sudo USER="$USER" --preserve-env "$SOURCE" "$@"
exit
fi
@@ -78,7 +78,7 @@ then
# Fetch Ngrok URL In Background...
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
# Finally, for every other command we will just proxy into the PHP tool