aboutsummaryrefslogtreecommitdiff
path: root/common/git-clone.sh
blob: 1a1a89cdb7cc6fbe1732338d9598ac0595a2fbab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
set -euo pipefail

# Input environment:
# - NAME: a name for the script/tasks
# - URL: the url of the repository to clone

WORKDIR="/tmp/${NAME}"

cleanup() {
	rm -rf "${WORKDIR}"
}

trap cleanup EXIT

git clone -q "${URL}" "${WORKDIR}"

trap - EXIT