diff --git a/bin/framework-pull-upstream.sh b/bin/framework-pull-upstream.sh index 6e15bb94b..967df192b 100755 --- a/bin/framework-pull-upstream.sh +++ b/bin/framework-pull-upstream.sh @@ -81,13 +81,27 @@ if [ -f ".env" ]; then fi fi -# Verify rspade_upstream remote exists +# Verify rspade_upstream remote exists, auto-configure for project mode if ! git remote get-url rspade_upstream >/dev/null 2>&1; then - echo "ERROR: Remote \"rspade_upstream\" not configured." - echo "" - echo "Configure the upstream remote:" - echo " git remote add rspade_upstream " - exit 1 + # Auto-configure remote for project mode (when system/ is a submodule) + if [ "$IS_PROJECT_MODE" = false ] && [ -f "../.gitmodules" ] && grep -q "path = system" ../.gitmodules 2>/dev/null; then + echo "→ Configuring rspade_upstream remote (first-time setup)..." + UPSTREAM_URL="ssh://git@privategit.hanson.xyz:3322/brianhansonxyz/rspade_system.git" + if git remote add rspade_upstream "$UPSTREAM_URL" 2>&1; then + echo " ✓ Remote configured: $UPSTREAM_URL" + echo "" + else + echo "ERROR: Failed to configure rspade_upstream remote." + exit 1 + fi + else + # Framework dev mode or can't auto-detect - require manual configuration + echo "ERROR: Remote \"rspade_upstream\" not configured." + echo "" + echo "Configure the upstream remote:" + echo " git remote add rspade_upstream " + exit 1 + fi fi echo ""