refactor: Streamline master repository setup
This commit is contained in:
parent
92e68fff00
commit
8d984e2511
1 changed files with 11 additions and 5 deletions
|
|
@ -8,10 +8,13 @@ set -euo pipefail
|
||||||
source "lib/output.sh"
|
source "lib/output.sh"
|
||||||
source "config.env"
|
source "config.env"
|
||||||
source "lib/scaffold.sh"
|
source "lib/scaffold.sh"
|
||||||
|
source "providers/${PROVIDER}.sh" # Required for remote creation
|
||||||
|
|
||||||
step "Configuring Master Repository: ${MASTER_REPO}"
|
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}"
|
mkdir -p "${WORK_DIR}/${MASTER_REPO}"
|
||||||
cd "${WORK_DIR}/${MASTER_REPO}"
|
cd "${WORK_DIR}/${MASTER_REPO}"
|
||||||
|
|
||||||
|
|
@ -19,16 +22,19 @@ if [ ! -d ".git" ]; then
|
||||||
info "Initializing Git in Master repository..."
|
info "Initializing Git in Master repository..."
|
||||||
git init
|
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
|
if [ -n "${GIST_URL:-}" ]; then
|
||||||
info "Adding core-karpathy as an external reference..."
|
info "Adding core-karpathy as an external reference..."
|
||||||
git submodule add "${GIST_URL}" core-karpathy || warn "Could not add core-karpathy submodule."
|
git submodule add "${GIST_URL}" core-karpathy || warn "Could not add core-karpathy submodule."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Apply master-level templates (README, AGENTS)
|
|
||||||
scaffold_master "."
|
scaffold_master "."
|
||||||
|
|
||||||
# Initial commit for the master structure
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "chore: initialize master scaffold" || info "No changes to commit in master."
|
git commit -m "chore: initialize master scaffold" || info "No changes to commit in master."
|
||||||
|
|
||||||
|
# 3. Initial Push
|
||||||
|
git push -u origin main
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue