From 7425f60614997cf848500aff90565272709a554f Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 5 Feb 2016 20:39:52 -0800 Subject: [PATCH] add a dev mode to the flutter script --- bin/flutter | 5 +++++ bin/flutter.bat | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/bin/flutter b/bin/flutter index 1ec69b6713..3743c52276 100755 --- a/bin/flutter +++ b/bin/flutter @@ -15,6 +15,11 @@ SCRIPT_PATH="$FLUTTER_TOOLS_DIR/bin/flutter_tools.dart" # TODO(abarth): We shouldn't require dart to be on the user's path. DART=dart +if [ -n $FLUTTER_DEV ]; then + $DART --checked --package-root="$FLUTTER_TOOLS_DIR/packages" "$SCRIPT_PATH" "$@" + exit 0 +fi + REVISION=`(cd "$FLUTTER_ROOT"; git rev-parse HEAD)` if [ ! -f "$SNAPSHOT_PATH" ] || [ ! -f "$STAMP_PATH" ] || [ `cat "$STAMP_PATH"` != "$REVISION" ] || [ "$FLUTTER_TOOLS_DIR/pubspec.yaml" -nt "$FLUTTER_TOOLS_DIR/pubspec.lock" ]; then echo Updating flutter tool... diff --git a/bin/flutter.bat b/bin/flutter.bat index d047aa605c..ed79c19114 100644 --- a/bin/flutter.bat +++ b/bin/flutter.bat @@ -13,6 +13,11 @@ SET script_path=%flutter_tools_dir%\bin\flutter_tools.dart REM TODO: Don't require dart to be on the user's path SET dart=dart +IF "%FLUTTER_DEV%" == "" GOTO no_flutter_dev +CALL %dart% --checked --package-root="%flutter_tools_dir%\packages" "%script_path%" %* +EXIT /B %ERRORLEVEL% +:no_flutter_dev + REM Set current working directory to the flutter directory PUSHD %flutter_root% REM IF doesn't have an "or". Instead, just use GOTO