From 6d41c704b98022adcea57d457508773e3320cbb6 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 8 Feb 2017 14:46:47 -0800 Subject: [PATCH] Preserve exit code on Windows (#7987) --- bin/flutter.bat | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/flutter.bat b/bin/flutter.bat index 3d621950d6..243fd86c15 100644 --- a/bin/flutter.bat +++ b/bin/flutter.bat @@ -86,9 +86,13 @@ GOTO :after_subroutine :after_subroutine CALL "%dart%" %FLUTTER_TOOL_ARGS% "%snapshot_path%" %* +SET exit_code=%ERRORLEVEL% REM The VM exits with code 253 if the snapshot version is out-of-date. -IF /I "%ERRORLEVEL%" EQU "253" ( - CALL "%dart%" --snapshot="%snapshot_path%" --packages="%flutter_tools_dir%\.packages" "%script_path%" - CALL "%dart%" %FLUTTER_TOOL_ARGS% "%snapshot_path%" %* +IF /I "%exit_code%" EQU "253" ( + CALL "%dart%" --snapshot="%snapshot_path%" --packages="%flutter_tools_dir%\.packages" "%script_path%" + CALL "%dart%" %FLUTTER_TOOL_ARGS% "%snapshot_path%" %* + SET exit_code=%ERRORLEVEL% ) + +EXIT %exit_code%