23
scripts/push-to-ckb-nas.sh
Normal file
23
scripts/push-to-ckb-nas.sh
Normal 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"
|
||||
Reference in New Issue
Block a user