Skip to content

Commit 189281f

Browse files
feat: add install script for single-binary policy
1 parent 81e95c7 commit 189281f

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

install.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
# Install container-compose v0.10.1 to /usr/local/bin
3+
# Usage: sudo ./install.sh
4+
5+
set -e
6+
7+
NEW_BINARY="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.build/release/container-compose"
8+
TARGET="/usr/local/bin/container-compose"
9+
10+
echo "Installing container-compose v0.10.1..."
11+
12+
# Check new binary exists
13+
if [ ! -f "$NEW_BINARY" ]; then
14+
echo "Error: Build the binary first with: ./build-release.sh"
15+
exit 1
16+
fi
17+
18+
# Check sudo needed
19+
if [ ! -w "/usr/local/bin" ] && [ "$EUID" -ne 0 ]; then
20+
echo "Error: Run with sudo: sudo ./install.sh"
21+
exit 1
22+
fi
23+
24+
# Install
25+
cp "$NEW_BINARY" "$TARGET"
26+
chmod 755 "$TARGET"
27+
28+
echo "✓ Installed: $TARGET"
29+
echo " Version: $($TARGET version 2>&1 | head -1)"
30+
31+
# Verify SINGLE binary
32+
echo ""
33+
echo "Checking for duplicate binaries..."
34+
FOUND=$(find /usr/local/bin /opt/homebrew/bin ~/bin ~/.local/bin -name "container-compose" -type f 2>/dev/null | wc -l | tr -d ' ')
35+
36+
if [ "$FOUND" -eq 1 ]; then
37+
echo "✓ Only one binary found: $(which container-compose)"
38+
elif [ "$FOUND" -gt 1 ]; then
39+
echo "⚠️ Found $FOUND binaries:"
40+
find /usr/local/bin /opt/homebrew/bin ~/bin ~/.local/bin -name "container-compose" -type f 2>/dev/null
41+
echo ""
42+
echo "Remove extras manually:"
43+
echo ' rm ~/bin/container-compose 2>/dev/null || true'
44+
else
45+
echo "✗ Binary not found in expected locations"
46+
fi

0 commit comments

Comments
 (0)