-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsetup
More file actions
executable file
·46 lines (39 loc) · 1.24 KB
/
setup
File metadata and controls
executable file
·46 lines (39 loc) · 1.24 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
set -euo pipefail
prepare_installer() {
echo "Initializing installer..."
SSI_VERSION="0.1.8"
# Set up tmp dir where all work is done
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
cd "$tmpdir"
export PATH="$tmpdir:$PATH"
# Download ssi if needed
if ! command -v ssi >/dev/null 2>&1 || [ "$(ssi --version 2>/dev/null)" != "$SSI_VERSION" ]; then
if command -v curl >/dev/null 2>&1; then
curl -fSsL https://github.com/DannyBen/ssi/releases/download/v$SSI_VERSION/ssi -o ssi
elif command -v wget >/dev/null 2>&1; then
wget -nv -O ssi https://github.com/DannyBen/ssi/releases/download/v$SSI_VERSION/ssi
else
echo "Error: please install wget or curl, then try again" >&2
exit 1
fi
chmod +x ssi
fi
}
prepare_installer
if ! command -v git >/dev/null 2>&1; then
echo "Error: please install git and try again" >&2
exit 1
fi
ssi log info Installing alf
ssi log debug Cloning github repo
git clone -q --depth 1 https://github.com/DannyBen/alf.git alf
ssi install bin alf/alf
ssi install man alf/doc
if command -v alf >/dev/null 2>&1; then
ssi log info "alf --version : $(alf --version)"
else
ssi log warn "alf not found on PATH after install"
fi
ssi log debug Installation complete