From a96073cb6718709559f1d09d0b98db21eb1201c1 Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Mon, 26 Aug 2024 21:50:00 -0700 Subject: [PATCH] print outpath only when not writing to a tty --- yaclog_ksp/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yaclog_ksp/__main__.py b/yaclog_ksp/__main__.py index 8d4f89b..3b7e32e 100644 --- a/yaclog_ksp/__main__.py +++ b/yaclog_ksp/__main__.py @@ -16,6 +16,8 @@ import pathlib import re +from sys import stdout + import click import yaclog @@ -111,7 +113,10 @@ def main(path, outpath, name): fp.write('KERBALCHANGELOG\n') fp.write(str(node)) - print(f'wrote output to {outpath}') + if stdout.isatty(): + print(f'wrote output to {outpath}') + else: + print(outpath) if __name__ == '__main__':