File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
44
55USE_PATH=false
6- if [ ! -z " $DEVTOOLS_TOOL_FLUTTER_FROM_PATH " ]; then
6+ if [ " $DEVTOOLS_TOOL_FLUTTER_FROM_PATH " = " true " ]; then
77 USE_PATH=true
88fi
99for arg in " $@ " ; do
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ REM found in the LICENSE file or at https://developers.google.com/open-source/li
44@ echo off
55
66set USE_PATH =
7- IF DEFINED DEVTOOLS_TOOL_FLUTTER_FROM_PATH set USE_PATH = 1
7+ IF /I " % DEVTOOLS_TOOL_FLUTTER_FROM_PATH% " == " true " set USE_PATH = 1
88for %%a in (%* ) do (
99 if " %%a " == " -p" set USE_PATH = 1
1010 if " %%a " == " --flutter-from-path" set USE_PATH = 1
Original file line number Diff line number Diff line change @@ -22,15 +22,15 @@ function flutter {
2222export -f flutter
2323
2424# Determine the Flutter SDK to use:
25- # * If `DEVTOOLS_TOOL_FLUTTER_FROM_PATH` is set , then discover from `PATH`.
25+ # * If `DEVTOOLS_TOOL_FLUTTER_FROM_PATH` is "true" , then discover from `PATH`.
2626# * If `./tool/flutter-sdk` (a directory) exists, then use that.
27- if [ -n " $DEVTOOLS_TOOL_FLUTTER_FROM_PATH " ]; then
27+ if [ " $DEVTOOLS_TOOL_FLUTTER_FROM_PATH " = " true " ]; then
2828 if command -v flutter & > /dev/null; then
2929 FLUTTER_EXE=" $( command -v flutter) "
3030 elif command -v flutter.bat & > /dev/null; then
3131 FLUTTER_EXE=" $( command -v flutter.bat) "
3232 else
33- echo " DEVTOOLS_TOOL_FLUTTER_FROM_PATH is set, but flutter was not found on PATH"
33+ echo " DEVTOOLS_TOOL_FLUTTER_FROM_PATH is set to true , but flutter was not found on PATH"
3434 exit 1
3535 fi
3636 FLUTTER_BIN=" $( cd " $( dirname " $FLUTTER_EXE " ) " && pwd -P) "
@@ -40,7 +40,7 @@ if [ -n "$DEVTOOLS_TOOL_FLUTTER_FROM_PATH" ]; then
4040elif [ -d " ./tool/flutter-sdk" ]; then
4141 FLUTTER_DIR=" $( pwd) /tool/flutter-sdk"
4242else
43- echo " Expected ./tool/flutter-sdk to exist, or DEVTOOLS_TOOL_FLUTTER_FROM_PATH to be set"
43+ echo " Expected ./tool/flutter-sdk to exist, or DEVTOOLS_TOOL_FLUTTER_FROM_PATH to be set to true "
4444 exit 1
4545fi
4646
Original file line number Diff line number Diff line change @@ -82,8 +82,10 @@ class DevToolsCommandRunner extends CommandRunner {
8282
8383 @override
8484 Future <void > runCommand (ArgResults topLevelResults) {
85+ final flutterFromPathEnvValue =
86+ Platform .environment[_flutterFromPathEnvVar] ?? '' ;
8587 final flutterFromPathEnv =
86- Platform .environment[_flutterFromPathEnvVar] ? .isNotEmpty == true ;
88+ bool . tryParse (flutterFromPathEnvValue, caseSensitive : false ) == true ;
8789 if (topLevelResults.flag (_flutterFromPathFlag) &&
8890 topLevelResults.wasParsed (_flutterSdkPathFlag)) {
8991 throw ArgParserException (
You can’t perform that action at this time.
0 commit comments