1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 00:20:08 +01:00

dont double sudo if already sudo

This commit is contained in:
Taylor Otwell
2016-05-10 14:40:52 -05:00
parent 70055c2f39
commit 33aac51c25

7
valet
View File

@@ -22,7 +22,12 @@ fi
if [[ "$1" = "install" ]] || [[ "$1" = "domain" ]] || [[ "$1" = "start" ]] || [[ "$1" = "restart" ]] || [[ "$1" = "stop" ]] || [[ "$1" = "uninstall" ]]
then
sudo php "$DIR/cli/valet.php" "$@"
if [[ "$EUID" -ne 0 ]]
then
sudo php "$DIR/cli/valet.php" "$@"
else
php "$DIR/cli/valet.php" "$@"
fi
elif [[ "$1" = "update" ]]
then
bash <(curl -s https://raw.githubusercontent.com/laravel/valet/master/update.sh)