diff --git a/bin/flutter b/bin/flutter index 3f6334d26bd..748702960f5 100755 --- a/bin/flutter +++ b/bin/flutter @@ -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."