1#!/bin/bash 2 3fail_on_output() { 4 tee /dev/stderr | not read 5} 6 7# not makes sure the command passed to it does not exit with a return code of 0. 8not() { 9 # This is required instead of the earlier (! $COMMAND) because subshells and 10 # pipefail don't work the same on Darwin as in Linux. 11 ! "$@" 12} 13 14die() { 15 echo "$@" >&2 16 exit 1 17}