From 89a550d8b316e40e82461625dfa9d83ad6083e78 Mon Sep 17 00:00:00 2001 From: "Michael Barney, Jr" Date: Tue, 16 Jan 2024 11:34:34 -0500 Subject: [PATCH 1/2] feat(cli): support receiving input from stdin --- setup.py | 2 +- transformation.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 8415fde..a66255b 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ long_description_content_type='text/markdown', py_modules=['transformation'], install_requires=[ - 'cfn-lint~=0.61.0', + 'cfn-lint~=0.83.2', 'click==7.1.2', ], entry_points=''' diff --git a/transformation.py b/transformation.py index 2e06fc5..40afdb2 100644 --- a/transformation.py +++ b/transformation.py @@ -1,3 +1,4 @@ +import sys import click import json @@ -7,9 +8,10 @@ # CLI for transforming SAM Templates @click.command() @click.option('-f','--file', 'output_file', help='Ouput result to specified file') -@click.argument('input') +@click.argument('input', type=click.File('r'), default=sys.stdin) def cli(input, output_file): - (json_file, errors) = decode.decode(input) + text = input.read() + (json_file, errors) = decode.decode_str(text) if errors: for match in errors: click.echo(match, err=True) From a1672072f5f9d12256856d271656a82eda7b2023 Mon Sep 17 00:00:00 2001 From: "Michael Barney, Jr" Date: Tue, 16 Jan 2024 11:38:27 -0500 Subject: [PATCH 2/2] feat(version): bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a66255b..16fb9f7 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='cfn-transform', - version='1.0.2', + version='1.1.0', author = 'Trek10, Inc', author_email = 'package-management@trek10.com', license='MIT',