mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 17:31:14 -03:00
cmake: Force color in the tests
For littlecheck/pexpect this just unconditionally enables color. I have no idea what happens if you run cmake outside of a terminal , but the worst that can happen is that *errors* have color escapes in them. If someone figures out how to get cmake to tell us if it's running in a terminal, we can add a check.
This commit is contained in:
@@ -688,6 +688,13 @@ def get_argparse():
|
||||
help="Show the files to be checked",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--force-color",
|
||||
action="store_true",
|
||||
dest="force_color",
|
||||
help="Force usage of color even if not connected to a terminal",
|
||||
default=False,
|
||||
)
|
||||
parser.add_argument("file", nargs="+", help="File to check")
|
||||
return parser
|
||||
|
||||
@@ -702,7 +709,7 @@ def main():
|
||||
failed = False
|
||||
skip_count = 0
|
||||
config = Config()
|
||||
config.colorize = sys.stdout.isatty()
|
||||
config.colorize = args.force_color or sys.stdout.isatty()
|
||||
config.progress = args.progress
|
||||
fields = config.colors()
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ class SpawnedProc(object):
|
||||
if name not in env:
|
||||
raise ValueError("'%s' variable not found in environment" % name)
|
||||
exe_path = env.get(name)
|
||||
self.colorize = sys.stdout.isatty()
|
||||
self.colorize = sys.stdout.isatty() or env.get("FISH_FORCE_COLOR", "0") == "1"
|
||||
self.messages = []
|
||||
self.start_time = None
|
||||
self.spawn = pexpect.spawn(exe_path, env=env, encoding="utf-8", timeout=timeout, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user