#!/usr/bin/env bash if [ -z "$1" -o -z "$2" -o -z "$3" ] then # print help cat <&1 | tee "$OLD_FILE" # there is a diff, so restore the changes git checkout "$BRANCH_MOV" || exit 1 # now if we're interrupted, we should only exit immediately trap "exit 1" SIGHUP SIGINT SIGTERM # run the given `make` command, passing `TIMED=1` to get timing and # `-k` to continue even if files fail $MAKECMD TIMED=1 -k 2>&1 | tee "$NEW_FILE" popd 1>/dev/null