Skip to content

Commit

Permalink
Add colored diff output to diff
Browse files Browse the repository at this point in the history
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
  • Loading branch information
Swiddis committed Jul 6, 2023
1 parent 39e1ba1 commit 4f88a1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/src/diff/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ def output_diff(difference: dict[str, object], prefix: str = "") -> None:
if "expected" not in value and "actual" not in value:
output_diff(value, f"{prefix}{key}.")
if value.get("actual") is not None:
click.echo(f"- {out_key}: {json.dumps(value.get('actual'))}")
click.secho(f"- {out_key}: {json.dumps(value.get('actual'))}", fg="red")
if value.get("expected") is not None:
click.echo(f"+ {out_key}: {json.dumps(value.get('expected'))}")
click.secho(f"+ {out_key}: {json.dumps(value.get('expected'))}", fg="green")


@click.command()
Expand Down

0 comments on commit 4f88a1b

Please sign in to comment.