tools: win: Fix grep usage with system Git (see #3836)

This commit is contained in:
Marshall Greenblatt
2025-02-19 12:05:35 -05:00
parent 64bb2aadd5
commit 0c25276083
2 changed files with 18 additions and 4 deletions

View File

@ -96,6 +96,9 @@ def compute_next_api_verson(api_versions_file):
def git_grep_next(cef_dir):
cmd = "grep --no-color -n -E (CEF_NEXT|CEF_NEXT)|=next -- :!include/cef_api_hash.h *.h"
if sys.platform == 'win32':
# Pass the pipe (|) character as a literal argument.
cmd = cmd.replace('|', '^|')
return exec_git_cmd(cmd, cef_dir)
@ -362,8 +365,10 @@ def exec_check(cpp_header_dir, api_versions_file, api_untracked_file, debug_dir,
print('WARNING: This change can break back/forward binary compatibility.')
else:
sys.stderr.write('ERROR: %d hashes checked and failed\n' % len_failed)
sys.stderr.write('\nFor debugging tips/tricks see\n' +
'https://github.com/chromiumembedded/cef/issues/3836#issuecomment-2587767028\n\n')
sys.stderr.write(
'\nFor debugging tips/tricks see\n' +
'https://github.com/chromiumembedded/cef/issues/3836#issuecomment-2587767028\n\n'
)
print('%d hashes checked and match (%d/%d versioned, %d/%d untracked).' %
(len(versions) - len_failed,