Files
workphone-sdk/scripts/sync_to_gitea_github.sh
2026-02-24 14:13:42 +08:00

19 lines
818 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# ============================================
# 工作手机 SDK → Gitea + GitHub 双推
# 用法:在项目根目录执行 bash scripts/sync_to_gitea_github.sh
# ============================================
REPO_DIR="/Users/karuo/Documents/开发/2、私域银行/工作手机"
cd "$REPO_DIR" || exit 1
# 提交变更
git add -A
if git diff --cached --quiet; then
echo "无变更,跳过"
exit 0
fi
git commit -m "chore: $(date '+%Y-%m-%d %H:%M') 同步 | 工作手机 SDK 更新"
# 推送github 优先gitea 需先创建仓库)
git push github main 2>/dev/null && echo "✅ GitHub 推送成功" || echo "⚠️ GitHub 推送失败"
git push gitea main 2>/dev/null && echo "✅ Gitea 推送成功" || echo "⚠️ Gitea: 需先在 open.quwanzhi.com 创建 fnvtk/workphone-sdk 仓库"