From d625750652cfb548f9f1ca464d3065a6623f04b6 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 13 May 2024 19:10:35 +0000 Subject: [PATCH] gclient: error if grep command is called in cog env Bug: 339231299 Change-Id: I8b1d0e76342b180a4ec100f22ce8be85b9a35664 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5533260 Reviewed-by: Josip Sokcevic Auto-Submit: Yiwei Zhang Commit-Queue: Yiwei Zhang --- gclient.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gclient.py b/gclient.py index 4f3ee24f5..119527a7f 100755 --- a/gclient.py +++ b/gclient.py @@ -3491,6 +3491,9 @@ def CMDgrep(parser, args): file=sys.stderr) return 1 + if gclient_utils.IsEnvCog(): + raise gclient_utils.Error('gclient grep command is not supported.') + jobs_arg = ['--jobs=1'] if re.match(r'(-j|--jobs=)\d+$', args[0]): jobs_arg, args = args[:1], args[1:]