tree: adbc51e7ba4209444c7220ed918996307e3574ea [path history] [tgz]
  1. BUILD.bazel
  2. README.md
  3. savestdout.go
build/savestdout/README.md

savestdout

savestdout is a small tool to save the stdout of a command to a file, without using a shell.

It was made to be used in Bazel rule definitions that want to run a command and save its output to stdout without going through ctx.actions.run_shell.

Once bazelbuild/bazel/issues/5511 gets fixed, rules that need this behaviour can start using native Bazel functionality instead, and this tool should be deleted.

Usage

Command line usage:

bazel build //build/savestdout
bazel run bazel-bin/build/savestdout/*/savestdout /tmp/foo ps aux

For an example of use in rules, see smalltown_initramfs in //code/def.bzl.