forked from tigerbeetle/tigerbeetle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·55 lines (44 loc) · 1.55 KB
/
bootstrap.sh
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
50
51
52
53
54
55
#!/bin/sh
# Since this script potentially updates itself, putting the script in
# braces forces sh to parse the entire script before executing it so
# it isn't concurrently parsing a script that is changing on disk.
# https://stackoverflow.com/a/2358432/1507139
{
from_source=""
if [ "$1" = "-build" ]; then
from_source="t"
fi
set -e
# Make sure we're in the repository root.
cd "$( dirname "$0" )"
git fetch --tags --force --quiet
version="$(git describe --tags "$(git rev-list --tags --max-count=1)")"
os="$(uname)"
arch="$(uname -m)"
if [ "$from_source" = "" ]; then
echo "Downloading pre-built TigerBeetle binary for your machine."
echo ""
if [ "$os" = "Darwin" ]; then
arch="universal"
os="macos"
elif [ "$os" = "Linux" ]; then
os="linux"
else
echo "Unsupported OS."
exit 1
fi
curl -sLO "https://github.com/tigerbeetle/tigerbeetle/releases/download/$version/tigerbeetle-$arch-$os.zip"
unzip -qo "tigerbeetle-$arch-$os.zip"
chmod +x tigerbeetle
else
echo "Building TigerBeetle binary from source for your machine."
echo ""
git checkout "$version"
./scripts/install.sh
fi
echo "Successfully set up $(./tigerbeetle version) at $(pwd)/tigerbeetle.
To get started running TigerBeetle and interacting with it, see:
https://github.com/tigerbeetle/tigerbeetle#running-tigerbeetle"
# See https://stackoverflow.com/a/2358432/1507139.
exit 0
}