mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-21 17:40:45 -06:00
fix: if NO_COLOR set ignore ansi.custom setting
This commit is contained in:
parent
14b6dccbc9
commit
6dad870b23
1 changed files with 26 additions and 22 deletions
|
@ -65,6 +65,9 @@ class Ansi:
|
|||
"""use custom color"""
|
||||
|
||||
code, end = "\033[", "m"
|
||||
if not sys.stdout.isatty() or os.getenv("NO_COLOR", False):
|
||||
return ""
|
||||
else:
|
||||
if fg:
|
||||
if isinstance(fg, int):
|
||||
code += f"38;5;{fg}"
|
||||
|
@ -112,5 +115,6 @@ class Ansi:
|
|||
a = ansi = Ansi()
|
||||
|
||||
cfg = Config(
|
||||
"$(DIVIDER)", "$(HELP_SEP)", f"""$(EPILOG)""", f"""$(USAGE)""",int('$(WRAP)'))
|
||||
"$(DIVIDER)", "$(HELP_SEP)", f"""$(EPILOG)""", f"""$(USAGE)""", int("$(WRAP)")
|
||||
)
|
||||
#% endblock %#
|
||||
|
|
Loading…
Reference in a new issue