From 8d984e2511733a9717fac23060decc32c93a723f Mon Sep 17 00:00:00 2001 From: Matteo Cherubini Date: Sat, 9 May 2026 11:34:21 +0200 Subject: [PATCH] refactor: Streamline master repository setup --- scripts/setup-master.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/setup-master.sh b/scripts/setup-master.sh index 7d9bf6f..4707f5b 100644 --- a/scripts/setup-master.sh +++ b/scripts/setup-master.sh @@ -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