bin/flutter: don’t warn about running as root within Docker container (#10535)

Closes https://github.com/flutter/flutter/issues/10529

Via https://stackoverflow.com/a/25518345/39827
This commit is contained in:
Kevin Moore 2017-06-06 12:22:34 -07:00 committed by Todd Volkert
parent c8e4cbf27d
commit a5aaaa8422

View File

@ -46,8 +46,8 @@ 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
# Test if running as superuser but don't warn if running within Docker
if [[ "$EUID" == "0" ]] && ! [[ -f /.dockerenv ]]; 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 " /"