blob: c6faadae212778ccf3ecc861d746fe31d773adaf [file] [log] [blame] [view]
Serge Bazanski140bddc2020-06-05 21:01:19 +02001savestdout
2==========
3
4`savestdout` is a small tool to save the stdout of a command to a file, without using
5a shell.
6
7It was made to be used in Bazel rule definitions that want to run a command and save
Serge Bazanski662b5b32020-12-21 13:49:00 +01008its output to stdout without going through `ctx.actions.run\_shell`.
Serge Bazanski140bddc2020-06-05 21:01:19 +02009
10Once [bazelbuild/bazel/issues/5511](https://github.com/bazelbuild/bazel/issues/5511)
11gets fixed, rules that need this behaviour can start using native Bazel functionality
12instead, and this tool should be deleted.
13
14Usage
15-----
16
17Command line usage:
18
19 bazel build //build/savestdout
20 bazel run bazel-bin/build/savestdout/*/savestdout /tmp/foo ps aux
21
Serge Bazanski662b5b32020-12-21 13:49:00 +010022For an example of use in rules, see `node_initramfs` in `//code/def.bzl`.