From 2d4e4dd6dce9d4cb22586fc11d7f139b354a0562 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Fri, 24 Feb 2017 15:26:36 -0800 Subject: [PATCH] Fix timestamp comparison in BAT file (#8407) --- bin/flutter.bat | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/flutter.bat b/bin/flutter.bat index b7f79b4088..3a21421700 100644 --- a/bin/flutter.bat +++ b/bin/flutter.bat @@ -65,10 +65,14 @@ GOTO :after_subroutine IF NOT EXIST "%stamp_path%" GOTO do_snapshot SET /p stamp_value=<"%stamp_path%" IF !stamp_value! NEQ !revision! GOTO do_snapshot - REM Get modified timestamps - FOR %%f IN ("%flutter_tools_dir%\pubspec.yaml") DO SET yamlt=%%~tf - FOR %%a IN ("%flutter_tools_dir%\pubspec.lock") DO SET lockt=%%~ta - IF !lockt! LSS !yamlt! GOTO do_snapshot + REM Compare "last modified" timestamps + SET pubspec_yaml_path=%flutter_tools_dir%\pubspec.yaml + SET pubspec_lock_path=%flutter_tools_dir%\pubspec.lock + FOR %%i IN ("%pubspec_yaml_path%") DO SET yaml_timestamp=%%~ti + FOR %%i IN ("%pubspec_lock_path%") DO SET lock_timestamp=%%~ti + IF !yaml_timestamp! EQU !lock_timestamp! GOTO do_snapshot + FOR /F %%i IN ('DIR /B /O:D "%pubspec_yaml_path%" "%pubspec_lock_path%"') DO SET newer_file=%%i + IF "%newer_file%" EQU "pubspec.yaml" GOTO do_snapshot REM Everything is uptodate - exit subroutine EXIT /B