From 8ca73cd2d0e2fdea219fd3e4dc3fcdeccb850a1e Mon Sep 17 00:00:00 2001 From: Jim Graham Date: Fri, 29 Apr 2022 13:34:03 -0700 Subject: [PATCH] allow either host_debug or host_debug_unopt for pre-push verification (flutter/engine#33000) --- .../githooks/lib/src/pre_push_command.dart | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/engine/src/flutter/tools/githooks/lib/src/pre_push_command.dart b/engine/src/flutter/tools/githooks/lib/src/pre_push_command.dart index 0a735b8c589..5f571a2bfae 100644 --- a/engine/src/flutter/tools/githooks/lib/src/pre_push_command.dart +++ b/engine/src/flutter/tools/githooks/lib/src/pre_push_command.dart @@ -37,7 +37,7 @@ class PrePushCommand extends Command { final Stopwatch sw = Stopwatch()..start(); // First ensure that out/host_debug/compile_commands.json exists by running // //flutter/tools/gn. - final io.File compileCommands = io.File(path.join( + io.File compileCommands = io.File(path.join( flutterRoot, '..', 'out', @@ -45,14 +45,15 @@ class PrePushCommand extends Command { 'compile_commands.json', )); if (!compileCommands.existsSync()) { - final bool gnResult = await _runCheck( + compileCommands = io.File(path.join( flutterRoot, - path.join(flutterRoot, 'tools', 'gn'), - [], - 'GN for host_debug', - verbose: verbose, - ); - if (!gnResult) { + '..', + 'out', + 'host_debug_unopt', + 'compile_commands.json', + )); + if (!compileCommands.existsSync()) { + io.stderr.writeln('clang-tidy requires a fully built host_debug or host_debug_unopt build directory'); return false; } }