-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·65 lines (52 loc) · 1.4 KB
/
install.sh
File metadata and controls
executable file
·65 lines (52 loc) · 1.4 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
#!/bin/bash
# gotoni installation script
set -e
REPO="atoniolo76/gotoni"
INSTALL_DIR="/usr/local/bin"
BINARY_NAME="gotoni"
# Detect OS
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
# Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64)
ARCH="amd64"
;;
aarch64|arm64)
ARCH="arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
# Determine binary name
if [ "$OS" = "windows" ] || [ "$OS" = "mingw" ]; then
BINARY_FILE="gotoni-${OS}-${ARCH}.exe"
else
BINARY_FILE="gotoni-${OS}-${ARCH}"
fi
# Get latest release URL
LATEST_URL="https://github.com/${REPO}/releases/latest/download/${BINARY_FILE}"
echo "Installing gotoni..."
echo "Platform: ${OS}-${ARCH}"
echo "Downloading from: ${LATEST_URL}"
# Download binary
TMP_DIR=$(mktemp -d)
trap "rm -rf $TMP_DIR" EXIT
if ! curl -fsSL "$LATEST_URL" -o "$TMP_DIR/$BINARY_NAME"; then
echo "Error: Failed to download binary. Make sure the release exists and your platform is supported."
exit 1
fi
# Make executable
chmod +x "$TMP_DIR/$BINARY_NAME"
# Install to /usr/local/bin (requires sudo)
if [ -w "$INSTALL_DIR" ]; then
mv "$TMP_DIR/$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
else
echo "Installing to $INSTALL_DIR (requires sudo)..."
sudo mv "$TMP_DIR/$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME"
fi
echo "✓ gotoni installed successfully to $INSTALL_DIR/$BINARY_NAME"
echo ""
echo "Run 'gotoni --help' to get started!"