-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick-install.sh
More file actions
executable file
·42 lines (30 loc) · 1 KB
/
quick-install.sh
File metadata and controls
executable file
·42 lines (30 loc) · 1 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
#!/bin/bash
# One-liner installer - can be run directly from curl
set -e
REPO="mcp-shark-org/cli"
INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}"
BINARY_NAME="mcp-shark-cli"
# Get latest release
LATEST_TAG=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' || echo "main")
echo "Installing @mcp-shark/cli ($LATEST_TAG)..."
# Create install directory
mkdir -p "$INSTALL_DIR"
# Download and extract
TMP_DIR=$(mktemp -d)
trap "rm -rf $TMP_DIR" EXIT
curl -sL "https://github.com/$REPO/archive/refs/tags/$LATEST_TAG.tar.gz" -o "$TMP_DIR/cli.tar.gz"
cd "$TMP_DIR"
tar -xzf cli.tar.gz
CLI_DIR=$(find . -maxdepth 1 -type d -name "cli-*" | head -1)
cd "$CLI_DIR"
npm install --production --silent
# Create wrapper
cat > "$INSTALL_DIR/$BINARY_NAME" << EOF
#!/bin/bash
exec node "$(pwd)/cli.js" "\$@"
EOF
chmod +x "$INSTALL_DIR/$BINARY_NAME"
echo "✓ Installed to $INSTALL_DIR/$BINARY_NAME"
echo ""
echo "Add to PATH:"
echo " export PATH=\"\$PATH:$INSTALL_DIR\""