From 50894b5f11a213555e7ac149dd0fdac5b5dad4b2 Mon Sep 17 00:00:00 2001 From: Rob van der Leek <5324924+robvanderleek@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:56:51 +0100 Subject: [PATCH] Do not show TUI in GH Actions --- codelimit/__main__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codelimit/__main__.py b/codelimit/__main__.py index a43fa78..440c1da 100755 --- a/codelimit/__main__.py +++ b/codelimit/__main__.py @@ -1,4 +1,5 @@ import os +import sys from pathlib import Path from typing import List, Annotated, Optional from rich import print @@ -73,8 +74,9 @@ def scan( cache_dir_gitignore = cache_dir.joinpath(".gitignore").resolve() cache_dir_gitignore.write_text("# Created by codelimit automatically.\n*\n") report_path.write_text(ReportWriter(report).to_json()) - app = CodeLimitApp(report) - app.run() + if sys.stdout.isatty(): + app = CodeLimitApp(report) + app.run() @cli.command(help="Upload report to Code Limit")