mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Exit with error message when run as root (#8626)
This commit is contained in:
parent
a4125f3b0e
commit
81b81d3087
@ -46,6 +46,15 @@ DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk"
|
||||
DART="$DART_SDK_PATH/bin/dart"
|
||||
PUB="$DART_SDK_PATH/bin/pub"
|
||||
|
||||
# Test if running as superuser
|
||||
if [[ "$EUID" == "0" ]]; then
|
||||
echo " Woah! You appear to be trying to run flutter as root."
|
||||
echo " We strongly recommend running the flutter tool without superuser privileges."
|
||||
echo " /"
|
||||
echo "📎"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test if Git is available on the Host
|
||||
if ! hash git 2>/dev/null; then
|
||||
echo "Error: Unable to find git in your PATH."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user