-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·59 lines (48 loc) · 1.7 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·59 lines (48 loc) · 1.7 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
#!/bin/bash
set -e
REPO="dssnet/attache"
REPO_URL="https://github.com/$REPO"
echo ""
echo " ╔═══════════════════════════════════════╗"
echo " ║ Attaché Installer ║"
echo " ╚═══════════════════════════════════════╝"
echo ""
# Step 1: Install Bun if not present
if command -v bun &>/dev/null; then
echo " ✓ Bun is already installed ($(bun --version))"
else
echo " Installing Bun..."
curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
echo " ✓ Bun installed ($(bun --version))"
fi
echo ""
# Step 2: Fetch latest release tag
echo " Fetching latest version..."
TAG=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name"' | head -1 | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')
if [ -z "$TAG" ]; then
echo " ✗ Failed to fetch latest version"
exit 1
fi
echo " ✓ Latest version: $TAG"
echo ""
# Step 3: Install from tag
echo " Installing Attaché $TAG..."
bun install -g "$REPO_URL#$TAG"
echo " ✓ Installed"
echo ""
# Step 4: Enable lingering for user services
if command -v loginctl &>/dev/null; then
if loginctl enable-linger "$(whoami)" 2>/dev/null; then
echo " ✓ Lingering enabled for $(whoami)"
elif sudo loginctl enable-linger "$(whoami)" 2>/dev/null; then
echo " ✓ Lingering enabled for $(whoami)"
else
echo " ⚠ Could not enable lingering automatically."
echo " Please run: sudo loginctl enable-linger $(whoami)"
fi
echo ""
fi
# Step 5: Run setup wizard
attache install < /dev/tty