Skip to content

Commit

Permalink
diff: exit 2 in case we find differences
Browse files Browse the repository at this point in the history
There's currently no way for consumers to differentiate between "there
was an error generating the diff" and "there were differences", since
both exit 1.

Unfortunately this is reversed from the diff command, which exits "0 if
the inputs are the same, 1 if different, 2 if trouble", but given
python's behavior I'm not sure we can reliably do better.
  • Loading branch information
jcristau committed Dec 18, 2024
1 parent 39d7017 commit 99faaab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcadmin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def diffCommand(**kwargs):
actual = await current.resources(expected.managed)
different = diff.show_diff(expected, actual)
if different:
sys.exit(1)
sys.exit(2)

@cmd.command(name="check")
@options.generate_options.apply
Expand Down

0 comments on commit 99faaab

Please sign in to comment.