diff options
Diffstat (limited to '')
-rw-r--r-- | common/make.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/make.sh b/common/make.sh new file mode 100644 index 0000000..c3b0912 --- /dev/null +++ b/common/make.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Input environment: +# - NAME: a name for the script/tasks +# - TARGET: the Makefile target to run + +WORKDIR="/tmp/${NAME}" + +cleanup() { + rm -rf "${WORKDIR}" +} + +trap cleanup EXIT + +(cd "${WORKDIR}" && make "${TARGET}") + +trap - EXIT |