Commit db041de6 authored by Jefferson Quesado's avatar Jefferson Quesado Committed by Jonah Williams

Detecting when installing over MingW's Git Bash, fixing paths (#39699)

parent e458fd08
......@@ -44,3 +44,4 @@ Simon Lightfoot <simon@devangels.london>
Sarbagya Dhaubanjar <mail@sarbagyastha.com.np>
Rody Davis Jr <rody.davis.jr@gmail.com>
Robin Jespersen <info@unitedpartners.de>
Jefferson Quesado <jeff.quesado@gmail.com>
......@@ -150,6 +150,15 @@ DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk"
DART="$DART_SDK_PATH/bin/dart"
PUB="$DART_SDK_PATH/bin/pub"
# If running over git-bash, overrides the default UNIX
# executables with win32 executables
case "$(uname -s)" in
MINGW32*)
DART="$DART.exe"
PUB="$PUB.bat"
;;
esac
# 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."
......
......@@ -50,6 +50,10 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t
DART_ZIP_NAME="dart-sdk-linux-x64.zip"
IS_USER_EXECUTABLE="-perm /u+x"
;;
MINGW32*)
DART_ZIP_NAME="dart-sdk-windows-x64.zip"
IS_USER_EXECUTABLE="-perm /u+x"
;;
*)
echo "Unknown operating system. Cannot install Dart SDK."
exit 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment