-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup
More file actions
executable file
·49 lines (41 loc) · 1.36 KB
/
setup
File metadata and controls
executable file
·49 lines (41 loc) · 1.36 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
47
48
49
#!/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 "ssi --version : $(ssi --version)"
ssi log info Installing rush
ssi log debug Cloning github repo
git clone -q --depth 1 https://github.com/DannyBen/rush.git rush
ssi install bin rush/rush
ssi install man rush/doc
rush completions | ssi install completion - --name rush
if command -v rush >/dev/null 2>&1; then
ssi log info "rush --version : $(rush --version)"
else
ssi log warn "rush not found on PATH after install"
fi
ssi log debug Installation complete