-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·44 lines (32 loc) · 885 Bytes
/
install.sh
File metadata and controls
executable file
·44 lines (32 loc) · 885 Bytes
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
#!/bin/bash
set -e
REPO="ShakthiW/cchat"
VERSION="v0.1.1"
APP_NAME="cchat"
INSTALL_PATH="/usr/local/bin"
echo "Detecting system..."
OS=$(uname -s)
ARCH=$(uname -m)
case "$OS" in
Linux*) GOOS="linux" ;;
Darwin*) GOOS="darwin" ;;
*) echo "Unsupported OS: $OS"; exit 1 ;;
esac
case "$ARCH" in
x86_64) GOARCH="amd64" ;;
arm64|aarch64) GOARCH="arm64" ;;
*) echo "Unsupported architecture: $ARCH"; exit 1 ;;
esac
FILE_NAME="${APP_NAME}-${GOOS}-${GOARCH}.tar.gz"
URL="https://github.com/${REPO}/releases/download/${VERSION}/${FILE_NAME}"
echo "Downloading $FILE_NAME..."
curl -L --progress-bar "$URL" -o "$FILE_NAME"
echo "Extracting..."
tar -xzf "$FILE_NAME"
echo "Installing binary to $INSTALL_PATH..."
chmod +x "$APP_NAME"
sudo mv "$APP_NAME" "$INSTALL_PATH/"
echo "Cleaning up..."
rm "$FILE_NAME"
echo "Installed successfully! Run with:"
echo " $APP_NAME --help"