Skip to content

Commit

Permalink
chore: show the return code when an SPM command fails (#477)
Browse files Browse the repository at this point in the history
- Add the `return_code` to the error message sent to stderr.
  • Loading branch information
cgrindel authored Jul 14, 2023
1 parent 15c00d4 commit 4759419
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion swiftpkg/internal/repository_utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ def _execute_spm_command(
if exec_result.return_code != 0:
if err_msg_tpl == None:
err_msg_tpl = """\
Failed to execute SPM command. name: {repo_name}, args: {exec_args}\n{stderr}.\
Failed to execute SPM command. \
name: {repo_name}, \
args: {exec_args}, \
return_code: {return_code}\
\n{stderr}.\
"""
fail(err_msg_tpl.format(
repo_name = repository_ctx.attr.name,
exec_args = exec_args,
stderr = exec_result.stderr,
return_code = exec_result.return_code,
))
return exec_result.stdout

Expand Down

0 comments on commit 4759419

Please sign in to comment.