-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·34 lines (26 loc) · 798 Bytes
/
Copy pathrun
File metadata and controls
executable file
·34 lines (26 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
#
# Download ajdev-init source & execute setup script.
#
# Env Var Default Description
# TMPDIR OS default or '/tmp' Temporary directory
# AJDEV_INIT_BRANCH main Branch to download
set -x
DL_DIR="${TMPDIR:-/tmp}/ajdev-init"
TGT_BRANCH="${AJDEV_INIT_BRANCH:-main}"
mkdir -p "$DL_DIR"
function cleanup() {
rm -rf "$DL_DIR"
}
trap cleanup EXIT INT
DL_URL="https://github.com/aspenjames/ajdev_init/archive/refs/heads/${TGT_BRANCH}.tar.gz"
pushd "$DL_DIR" || true
if [ -x "$(command -v curl)" ]; then
curl -L "$DL_URL" | tar xzf -
elif [ -x "$(command -v wget)" ]; then
wget -O- "$DL_URL" | tar xzf -
fi
pushd "$DL_DIR/ajdev_init-${TGT_BRANCH}" || true
bash ./setup
popd || true
popd || true