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

NAME=$1
URL=$2

WORKDIR="/tmp/${NAME}"

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

trap cleanup EXIT

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

trap - EXIT