#!/usr/bin/env bash # Mirror github.com/alchaincyf/nuwa-skill (MIT) into Moments private Gitea. # # Why we mirror: Atlas's claw-boss-distiller depends on nuwa-skill methodology # (`references/extraction-framework.md`). For air-gapped client deployments where # the client network cannot reach github.com, our private Gitea must serve nuwa. # # Prereq: a destination repo on git.moments.top must already exist (empty). # Default target: https://git.moments.top/Moments.top/nuwa-skill.git # # Create it once via Gitea UI (the bot account doesn't have org-create scope): # https://git.moments.top/repo/create → owner: Moments.top → name: nuwa-skill → empty # # Usage: # ./scripts/mirror-nuwa-to-moments.sh # ./scripts/mirror-nuwa-to-moments.sh https://git.moments.top/your-org/nuwa-skill.git # # After first mirror, schedule a weekly cron to re-mirror upstream changes. set -euo pipefail UPSTREAM="https://github.com/alchaincyf/nuwa-skill.git" TARGET="${1:-https://git.moments.top/Moments.top/nuwa-skill.git}" WORKDIR="$(mktemp -d -t nuwa-mirror-XXXXXX)" echo "Mirror $UPSTREAM → $TARGET" echo "Workdir: $WORKDIR" # Bare clone preserves all branches/tags/refs git clone --mirror "$UPSTREAM" "$WORKDIR" cd "$WORKDIR" # Push everything (--mirror = all refs incl. delete on remote) git push --mirror "$TARGET" cd / rm -rf "$WORKDIR" echo "✅ Mirror complete: $TARGET" echo echo "Next: update skills/claw-boss-distiller/upstream/README.md to point" echo " air-gapped deployments at the Moments mirror instead of GitHub."