blob: 6020cefc8a32528c4be569286776222590e66ced [file] [log] [blame]
Brian Silverman8dd8a052018-09-02 17:08:31 -07001#!/bin/bash
2
3# This program hides all the output on stderr from the called command, unless it
4# fails, in which case all the output is printed at the end.
5
6set -e
7set -u
8
9readonly STDERR_FILE="$(mktemp)"
10
11if ! "$@" 2>"${STDERR_FILE}" ; then
12 cat "${STDERR_FILE}"
13 exit 1
14fi