40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
#!/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"
|
|
source "providers/${PROVIDER}.sh" # Required for remote creation
|
|
|
|
step "Configuring Master Repository: ${MASTER_REPO}"
|
|
|
|
# 1. Remote Creation
|
|
provider_create_repo "${MASTER_REPO}" "Knowledge Genome Master Repository" "true"
|
|
|
|
mkdir -p "${WORK_DIR}/${MASTER_REPO}"
|
|
cd "${WORK_DIR}/${MASTER_REPO}"
|
|
|
|
if [ ! -d ".git" ]; then
|
|
info "Initializing Git in Master repository..."
|
|
git init
|
|
|
|
# 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
|
|
|
|
scaffold_master "."
|
|
git add .
|
|
git commit -m "chore: initialize master scaffold" || info "No changes to commit in master."
|
|
|
|
# 3. Initial Push
|
|
git push -u origin main
|