-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathinstall.sh
49 lines (39 loc) · 1.45 KB
/
install.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
#!/bin/bash
set -e
# set -x
# command check
commandExist() {
if ! command -v $1 >/dev/null 2>&1; then
echo "The $1 command is necessary. Please install the $1 software first."
exit 1
fi
}
# handle WSL system
if uname -r | grep -qEi "(Microsoft|WSL)"; then
echo "WSL detected. This script is not fully compatible with WSL. Please download the Windows runner instead by clicking this link"
exit 1
fi
commandExist "unzip"
commandExist "curl"
system=$(uname -s)
system=$(echo "$system" | tr '[:upper:]' '[:lower:]')
arch=$(uname -m)
if [ $arch = "x86_64" ]; then
arch="amd64"
fi
# latest_release=$(curl -s "https://api.github.com/repos/RiemaLabs/modular-indexer-light/releases/latest")
version=$(curl -s "https://api.github.com/repos/RiemaLabs/modular-indexer-light/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
zipfile="modular-indexer-light-$system-$arch.zip"
download_url="https://github.com/RiemaLabs/modular-indexer-light/releases/download/$version/$zipfile"
echo "Starting download $zipfile ......"
curl -SfLO $download_url
if [ -f "$zipfile" ]; then
unzip "$zipfile"
else
echo "Failed to download the $zipfile."
exit 1
fi
rm -f $zipfile
/bin/bash run.sh
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/RiemaLabs/modular-indexer-light/main/install.sh)"
# sh -c "$(wget https://raw.githubusercontent.com/RiemaLabs/modular-indexer-light/main/install.sh -O -)"