-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·29 lines (25 loc) · 1.16 KB
/
install.sh
File metadata and controls
executable file
·29 lines (25 loc) · 1.16 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
set -e
# Colors
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
RED="\033[1;31m"
RESET="\033[0m"
# Check dependencies
if ! command -v go >/dev/null 2>&1; then
echo -e "${RED}❌ Go is not installed. Please install Go first.${RESET}"
exit 1
fi
if ! command -v sudo >/dev/null 2>&1; then
echo -e "${RED}❌ 'sudo' is required to move binaries globally.${RESET}"
exit 1
fi
echo -e "${BLUE}🔧 Starting installation for ${GREEN}lattice-code${RESET}..."
sleep 0.5
# ──────────────────────────────────────────────
# Build lattice-code-runner
# ──────────────────────────────────────────────
echo -e "${YELLOW}→ Building lattice-code-runner from .d/cmd...${RESET}"
go build -o lattice-code-runner ./main.go || { echo -e "${RED}❌ Failed to build lattice-code-runner.${RESET}"; exit 1; }
echo -e "${BLUE}→ Moving binary to /usr/local/bin...${RESET}"
sudo mv lattice-code-runner /usr/local/bin/ || { echo -e "${RED}❌ Failed to move lattice-code-runner.${RESET}"; exit 1; }