Files
sproutclaw/scripts/push-sproutclaw.sh
root 0a91cc99d0
Some checks failed
CI / build-check-test (push) Has been cancelled
chore: add sproutclaw git workflow and track local extensions
Document main/upstream-sync/feature branch strategy, add sync/push
scripts, track .pi/agent extensions and webui in git, and disable
startup changelog via showChangelogOnStartup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 20:38:20 +08:00

33 lines
785 B
Bash
Executable File

#!/usr/bin/env bash
# Push main (and upstream-sync if present) to GitHub and Gitea.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
export GIT_HTTP_VERSION="${GIT_HTTP_VERSION:-1.1}"
BRANCH="$(git branch --show-current)"
if [[ "$BRANCH" != "main" ]]; then
echo "Checkout main before pushing (current: $BRANCH)" >&2
exit 1
fi
echo "==> Push main -> origin (GitHub)"
git push origin main
if git show-ref --verify --quiet refs/heads/upstream-sync; then
echo "==> Push upstream-sync -> origin"
git push origin upstream-sync
fi
if git remote get-url gitea &>/dev/null; then
echo "==> Push main -> gitea"
git push gitea main
if git show-ref --verify --quiet refs/heads/upstream-sync; then
git push gitea upstream-sync
fi
fi
echo "Done."