-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·41 lines (32 loc) · 967 Bytes
/
install.sh
File metadata and controls
executable file
·41 lines (32 loc) · 967 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
#!/usr/bin/env bash
set -e
REPO="alexanderritik/dbgraph" # Replace with actual repo if different
# Fetch latest version tag if no version specified
if [ -z "$1" ]; then
VERSION=$(curl -s https://api.github.com/repos/$REPO/releases/latest \
| grep tag_name \
| cut -d '"' -f 4)
else
VERSION=$1
fi
if [ -z "$VERSION" ]; then
echo "Error: Could not determine latest version."
exit 1
fi
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
# Map architecture names
if [ "$ARCH" = "x86_64" ]; then
ARCH="amd64"
elif [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then
ARCH="arm64"
fi
BINARY="dbgraph-${OS}-${ARCH}"
URL="https://github.com/$REPO/releases/download/$VERSION/$BINARY"
echo "Downloading $BINARY $VERSION..."
curl -L --fail $URL -o dbgraph
chmod +x dbgraph
# Move to path
echo "Installing to /usr/local/bin..."
sudo mv dbgraph /usr/local/bin/
echo "Installed successfully! Run 'dbgraph --version' to verify."