-
Notifications
You must be signed in to change notification settings - Fork 73
/
install.sh
49 lines (37 loc) · 1.23 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
# Define the application name
APP_NAME="allorad"
# Check for a version argument, otherwise set a default version
VERSION=${1:-"v0.2.8"}
# Define the base URL using the specified or default version
BASE_URL="https://github.com/allora-network/allora-chain/releases/download/$VERSION"
# Determine the operating system and architecture
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
case $ARCH in
x86_64)
ARCH="amd64"
;;
arm64)
ARCH="arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
# Construct the download URL
URL="${BASE_URL}/${APP_NAME}_${OS}_${ARCH}"
# Define the target directory
TARGET_DIR="$HOME/.local/bin"
# Create the target directory if it doesn't exist
mkdir -p "$TARGET_DIR"
# Download the file to /tmp
wget -O "/tmp/${APP_NAME}" "$URL"
# Move the binary to the target directory
mv "/tmp/${APP_NAME}" "$TARGET_DIR"
# Change permissions to make it executable
chmod +x "$TARGET_DIR/$APP_NAME"
echo "Installation complete. The $APP_NAME is now available in $TARGET_DIR"
echo "To make $APP_NAME available from any terminal session, add the following line to your .bashrc or .zshrc:"
echo "export PATH=\"\$PATH:$TARGET_DIR\""