添加 CKB NAS 同步脚本

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
卡若
2026-02-13 18:16:37 +08:00
parent a50e79c028
commit 1014f30ebe

View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# 银掌柜金融推送到 CKB NAS Git
# 用法:在银掌柜金融根目录执行 bash scripts/push-to-ckb-nas.sh
set -e
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" || true
if [ -z "$REPO_ROOT" ]; then
echo "错误:当前不在 Git 仓库内,请到银掌柜金融根目录执行。"
exit 1
fi
cd "$REPO_ROOT"
ORIGIN_URL="$(git remote get-url origin 2>/dev/null)" || true
if [ -z "$ORIGIN_URL" ]; then
echo "未配置 origin。"
git remote add origin "ssh://fnvtk@open.quwanzhi.com:22201/volume1/git/github/fnvtk/yinzhanggu-finance.git"
fi
echo "→ 推送到 CKB NAS (origin) ..."
git add -A
git diff --staged --quiet 2>/dev/null || git commit -m "银掌柜金融:更新"
git push origin main
echo "→ 完成。Git: ssh://fnvtk@open.quwanzhi.com:22201/volume1/git/github/fnvtk/yinzhanggu-finance.git"