beads/.devcontainer/setup.sh
matt wilkie 2ade22e84c
chore(build): codify the gms_pure_go build-tag policy (GH#3303)
Converges the sprinkle of -tags=gms_pure_go fixes into a single source plus a source-time CI guard. .buildflags is now canonical (exports GOFLAGS, CGO_ENABLED), scripts source it, scripts/check-build-tags.sh runs in CI to catch bare go commands. Fixes 5 latent bugs the guard caught (regression.yml, Makefile bench/test-regression, devcontainer, embedded-test-shard fallback, smoke-test scripts).
2026-04-16 12:28:11 -07:00

37 lines
898 B
Bash

#!/bin/bash
set -e
# Canonical build flags (GOFLAGS=-tags=gms_pure_go, CGO_ENABLED=1).
# shellcheck source=../.buildflags
source "$(dirname "$0")/../.buildflags"
echo "🔧 Building bd from source..."
go build -o bd ./cmd/bd
echo "📦 Installing bd globally..."
sudo mv bd /usr/local/bin/bd
sudo chmod +x /usr/local/bin/bd
echo "✅ Verifying bd installation..."
bd version
echo "🎯 Initializing bd (non-interactive)..."
if [ ! -f .beads/beads.db ]; then
bd init --quiet
else
echo "bd already initialized"
fi
echo "🪝 Installing git hooks..."
if [ -f examples/git-hooks/install.sh ]; then
bash examples/git-hooks/install.sh
echo "Git hooks installed successfully"
else
echo "⚠️ Git hooks installer not found, skipping..."
fi
echo "📚 Installing Go dependencies..."
go mod download
echo "✨ Development environment ready!"
echo "Run 'bd ready' to see available tasks"