This repository was archived by the owner on Feb 15, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
72 lines (56 loc) · 1.72 KB
/
install.sh
File metadata and controls
72 lines (56 loc) · 1.72 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
set -e
# Skillz Installer
# Installs the latest version of skillz CLI
REPO="tnfssc/skillz"
BINARY="skillz"
INSTALL_DIR="/usr/local/bin"
# Detect OS
OS="$(uname -s)"
case "$OS" in
Linux) OS="linux" ;;
Darwin) OS="darwin" ;;
*) echo "Unsupported OS: $OS"; exit 1 ;;
esac
# Detect Arch
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) ARCH="amd64" ;;
arm64) ARCH="arm64" ;;
aarch64) ARCH="arm64" ;;
*) echo "Unsupported Architecture: $ARCH"; exit 1 ;;
esac
echo "Installing skillz for $OS/$ARCH..."
# Get latest release tag
LATEST_TAG=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
if [ -z "$LATEST_TAG" ]; then
echo "Failed to fetch latest release version."
exit 1
fi
echo "Latest version: $LATEST_TAG"
# Construct download URL
# Format: skillz_Linux_x86_64.tar.gz
# GoReleaser format: {{ .ProjectName }}_{{ title .Os }}_{{ .Arch }}
OS_TITLE="$(echo "$OS" | awk '{print toupper(substr($0,1,1)) substr($0,2)}')"
if [ "$ARCH" = "amd64" ]; then
ARCH_TITLE="x86_64"
else
ARCH_TITLE="$ARCH"
fi
FILENAME="${BINARY}_${OS_TITLE}_${ARCH_TITLE}.tar.gz"
DOWNLOAD_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/$FILENAME"
echo "Downloading from $DOWNLOAD_URL..."
TMP_DIR=$(mktemp -d)
curl -fsSL "$DOWNLOAD_URL" -o "$TMP_DIR/$FILENAME"
echo "Extracting..."
tar -xzf "$TMP_DIR/$FILENAME" -C "$TMP_DIR"
echo "Installing to $INSTALL_DIR..."
if [ -w "$INSTALL_DIR" ]; then
mv "$TMP_DIR/$BINARY" "$INSTALL_DIR/$BINARY"
else
sudo mv "$TMP_DIR/$BINARY" "$INSTALL_DIR/$BINARY"
fi
chmod +x "$INSTALL_DIR/$BINARY"
rm -rf "$TMP_DIR"
echo "✅ Skillz installed successfully!"
echo "Run 'skillz --help' to get started."