diff --git a/tool/bin/devtools_tool b/tool/bin/devtools_tool index 9a4f319d91e..aa82b230f33 100755 --- a/tool/bin/devtools_tool +++ b/tool/bin/devtools_tool @@ -1,3 +1,11 @@ #!/bin/bash -e + SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -"$SCRIPT_DIR/../flutter-sdk/bin/dart" run "$SCRIPT_DIR/devtools_tool.dart" "$@" + +if [ ! -z "$DEVTOOLS_TOOL_FLUTTER_FROM_PATH" ] +then + echo Running devtools_tool using Dart/Flutter from PATH because DEVTOOLS_TOOL_FLUTTER_FROM_PATH is set + dart run "$SCRIPT_DIR/devtools_tool.dart" "$@" +else + "$SCRIPT_DIR/../flutter-sdk/bin/dart" run "$SCRIPT_DIR/devtools_tool.dart" "$@" +fi diff --git a/tool/bin/devtools_tool.bat b/tool/bin/devtools_tool.bat index f888c8045ae..ff41b51e15f 100644 --- a/tool/bin/devtools_tool.bat +++ b/tool/bin/devtools_tool.bat @@ -1,5 +1,10 @@ @echo off -%~dp0/../flutter-sdk/bin/dart run %~dp0/devtools_tool.dart %* +IF DEFINED DEVTOOLS_TOOL_FLUTTER_FROM_PATH ( + echo Running devtools_tool using Dart/Flutter from PATH because DEVTOOLS_TOOL_FLUTTER_FROM_PATH is set + dart run %~dp0/devtools_tool.dart %* +) ELSE ( + %~dp0/../flutter-sdk/bin/dart run %~dp0/devtools_tool.dart %* +) EXIT /B %errorlevel% diff --git a/tool/flutter_customer_tests/setup.sh b/tool/flutter_customer_tests/setup.sh index 3ea44750a70..b12677dd8ea 100755 --- a/tool/flutter_customer_tests/setup.sh +++ b/tool/flutter_customer_tests/setup.sh @@ -6,6 +6,8 @@ root_dir=$(pwd) tool_dir="$root_dir/tool/bin" export PATH=$PATH:$tool_dir +# Force devtools_tool to use the current Flutter (which is available on PATH). +export DEVTOOLS_TOOL_FLUTTER_FROM_PATH=true cd tool flutter pub get devtools_tool pub-get