refactor: Streamline master repository setup

This commit is contained in:
Matteo Cherubini 2026-05-09 11:34:21 +02:00
parent 92e68fff00
commit 8d984e2511

View file

@ -8,10 +8,13 @@ set -euo pipefail
source "lib/output.sh"
source "config.env"
source "lib/scaffold.sh"
source "providers/${PROVIDER}.sh" # Required for remote creation
step "Configuring Master Repository: ${MASTER_REPO}"
# Ensure workspace exists
# 1. Remote Creation
provider_create_repo "${MASTER_REPO}" "Knowledge Genome Master Repository" "true"
mkdir -p "${WORK_DIR}/${MASTER_REPO}"
cd "${WORK_DIR}/${MASTER_REPO}"
@ -19,16 +22,19 @@ if [ ! -d ".git" ]; then
info "Initializing Git in Master repository..."
git init
# Optional: Add Karpathy's core reference as a read-only submodule
# 2. Origin Configuration
SSH_URL=$(provider_ssh_url "${MASTER_REPO}")
git remote add origin "${SSH_URL}"
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."
# 3. Initial Push
git push -u origin main