disable ANSI color in the output of `build_fuzzers` when stdin's file descripter is not a terminal (#10632)

For example, ANSI colors will not be used when `stdin` is mapped to
`DEVNULL`.
This commit is contained in:
Dongge Liu 2023-07-05 11:30:22 +10:00 committed by GitHub
parent 448011e741
commit c6507f8b8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -833,9 +833,11 @@ def build_fuzzers_impl( # pylint: disable=too-many-arguments,too-many-locals,to
]
command += [
'-v', f'{project_out}:/out', '-v', f'{project.work}:/work', '-t',
'-v', f'{project_out}:/out', '-v', f'{project.work}:/work',
f'gcr.io/oss-fuzz/{project.name}'
]
if sys.stdin.isatty():
command.insert(-1, '-t')
result = docker_run(command, architecture=architecture)
if not result: