-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
51 lines (42 loc) · 1.17 KB
/
install.sh
File metadata and controls
51 lines (42 loc) · 1.17 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
#!/usr/bin/env bash
set -euo pipefail
REPO="yutamago/ado-cli"
BIN_NAME="ado"
INSTALL_DIR="${ADO_INSTALL_DIR:-$HOME/.local/bin}"
# Detect OS
OS="$(uname -s)"
case "$OS" in
Linux*) OS_NAME="linux" ;;
Darwin*) OS_NAME="darwin" ;;
*)
echo "Unsupported OS: $OS" >&2
exit 1
;;
esac
# Detect architecture
ARCH="$(uname -m)"
case "$ARCH" in
x86_64 | amd64) ARCH_NAME="x64" ;;
aarch64 | arm64) ARCH_NAME="arm64" ;;
*)
echo "Unsupported architecture: $ARCH" >&2
exit 1
;;
esac
BINARY="ado-${OS_NAME}-${ARCH_NAME}"
DOWNLOAD_URL="https://github.com/${REPO}/releases/latest/download/${BINARY}"
echo "Downloading ado CLI (${OS_NAME}/${ARCH_NAME})..."
mkdir -p "$INSTALL_DIR"
curl -fsSL "$DOWNLOAD_URL" -o "$INSTALL_DIR/$BIN_NAME"
chmod +x "$INSTALL_DIR/$BIN_NAME"
echo "Installed to $INSTALL_DIR/$BIN_NAME"
# PATH hint
if ! echo "$PATH" | tr ':' '\n' | grep -qx "$INSTALL_DIR"; then
echo ""
echo " $INSTALL_DIR is not in your PATH."
echo " Add it by appending this line to your shell profile (~/.bashrc, ~/.zshrc, etc.):"
echo ""
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
echo ""
fi
echo "Run 'ado --version' to verify the installation."