#!/usr/bin/env bash set -euo pipefail # Development environment setup script echo "Setting up development environment..." # Create directories if they don't exist mkdir -p logs mkdir -p reports mkdir -p reports/coverage mkdir -p reports/test-results mkdir -p reports/augments mkdir -p storage mkdir -p storage/keystore mkdir -p storage/cache mkdir -p .gocache # Check if Go is installed if ! command -v go &> /dev/null; then echo "Error: Go is not installed" >&2 exit 1 fi # Check if required tools are installed echo "Checking for required tools..." # Install golangci-lint if not present if ! command -v golangci-lint &> /dev/null; then echo "Installing golangci-lint..." go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest fi # Install gosec if not present if ! command -v gosec &> /dev/null; then echo "Installing gosec..." go install github.com/securego/gosec/v2/cmd/gosec@latest fi # Install govulncheck if not present if ! command -v govulncheck &> /dev/null; then echo "Installing govulncheck..." go install golang.org/x/vuln/cmd/govulncheck@latest fi # Install delve if not present if ! command -v dlv &> /dev/null; then echo "Installing delve..." go install github.com/go-delve/delve/cmd/dlv@latest fi # Copy example config if not exists if [ ! -f config/development.yaml ]; then echo "Creating development config..." cp config/development.yaml.example config/development.yaml 2>/dev/null || echo "Config example not found, creating basic config..." fi # Verify Go modules echo "Verifying Go modules..." go mod tidy echo "Development environment setup complete!"