#!/usr/bin/env bash # ============================================================================= # scripts/setup-master.sh # Initializes the umbrella (Master) repository and core configurations. # ============================================================================= set -euo pipefail source "lib/output.sh" source "config.env" source "lib/scaffold.sh" step "Configuring Master Repository: ${MASTER_REPO}" # Ensure workspace exists mkdir -p "${WORK_DIR}/${MASTER_REPO}" cd "${WORK_DIR}/${MASTER_REPO}" if [ ! -d ".git" ]; then info "Initializing Git in Master repository..." git init # Optional: Add Karpathy's core reference as a read-only submodule if [ -n "${GIST_URL:-}" ]; then info "Adding core-karpathy as an external reference..." git submodule add "${GIST_URL}" core-karpathy || warn "Could not add core-karpathy submodule." fi fi # Apply master-level templates (README, AGENTS) scaffold_master "." # Initial commit for the master structure git add . git commit -m "chore: initialize master scaffold" || info "No changes to commit in master."