Skip to content

Commit

Permalink
Pass stdout back from execute_and_return (RobotLocomotion#8824)
Browse files Browse the repository at this point in the history
This is useful for rules that need to parse the output of a command.
  • Loading branch information
jwnimmer-tri authored May 17, 2018
1 parent 12daea9 commit d2d044c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/workspace/execute.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def execute_and_return(repo_ctx, command, additional_search_paths = []):
error += "\n" + exec_result.stdout
if exec_result.stderr:
error += "\n" + exec_result.stderr
return struct(error = error)
return struct(
error = error,
stdout = exec_result.stdout)

def execute_or_fail(repo_ctx, command):
"""Runs the `command` (list) and immediately fails on any error."""
Expand Down

0 comments on commit d2d044c

Please sign in to comment.