diff options
Diffstat (limited to 'dev/ci/ci-pipe-tee.sh')
-rwxr-xr-x | dev/ci/ci-pipe-tee.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dev/ci/ci-pipe-tee.sh b/dev/ci/ci-pipe-tee.sh new file mode 100755 index 000000000..7b1ccddf2 --- /dev/null +++ b/dev/ci/ci-pipe-tee.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Use this script to preserve the exit code of $1 when piping it to +# `tee $2`. We have a separate script, because this only works in +# bash, which we don't require project-wide. + +"$1" 2>&1 | tee "$2" +exit ${PIPESTATUS[0]} |