Skip to content

Commit

Permalink
ensure exit code is set correctly when there are logged errors
Browse files Browse the repository at this point in the history
(not marking as a fix since it's an unreleased regression & problem with an unreleased feature)
  • Loading branch information
achidlow committed Sep 13, 2024
1 parent 1d7b06f commit eca3ca6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/puya/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ def main(*, options_json: str, awst_json: str, source_annotations_json: str | No
case other:
logger.error(f"unexpected compilation target type: {type(other).__name__}")
awst_to_teal(log_ctx, options, compilation_set, sources_by_path, awst)
# note: needs to be outside the with block
log_ctx.exit_if_errors()
3 changes: 2 additions & 1 deletion src/puyapy/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def compile_to_teal(puyapy_options: PuyaPyOptions) -> None:
log_ctx.exit_if_errors()
if puyapy_options.output_client:
write_arc32_clients(compilation_set, teal)
log_ctx.exit_if_errors()
# needs to be outside the with block
log_ctx.exit_if_errors()


def write_arc32_clients(
Expand Down

0 comments on commit eca3ca6

Please sign in to comment.