fix(SSOT): 库文件统一硬链到MoFin根目录canonical——今晚三处改造差点跑在陈旧副本上
- mo_data.py 提升为根目录canonical(含tag修复), deploy/profile-scripts/ scripts/ profile脚本目录 全部硬链到根 - mofin_db.py 同理(含strategy_history/tag迁移), 四处硬链统一 - sync_profile_scripts.sh 增加库文件链接步骤, merge后自动恢复 - 根因: deploy/profile-scripts/mofin_db.py 是7-20陈旧副本(无snapshot), profile脚本目录mo_data.py无tag——hygiene分叉副本检查正确报警
This commit is contained in:
@@ -11,6 +11,19 @@ for f in "$SRC"/*.py; do
|
||||
count=$((count+1))
|
||||
done
|
||||
ln -f "$SRC/sync_profile_scripts.sh" "$DST/sync_profile_scripts.sh" 2>/dev/null || true
|
||||
|
||||
# ── 库文件 SSOT:canonical 在 MoFin 根目录,其他位置只许硬链(红线#6)──
|
||||
# git checkout/merge 会重写文件破坏硬链,这里强制恢复
|
||||
ROOT="/home/hmo/MoFin"
|
||||
for lib in mofin_db.py mo_data.py; do
|
||||
if [ -f "$ROOT/$lib" ]; then
|
||||
ln -f "$ROOT/$lib" "$ROOT/deploy/profile-scripts/$lib" 2>/dev/null || true
|
||||
ln -f "$ROOT/$lib" "$ROOT/scripts/$lib" 2>/dev/null || true
|
||||
ln -f "$ROOT/$lib" "/home/hmo/web-dashboard/$lib" 2>/dev/null || true
|
||||
ln -f "$ROOT/$lib" "$DST/$lib" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
|
||||
echo "synced $count scripts (hardlink)"
|
||||
mkdir -p /home/hmo/MoFin/gateway/logs
|
||||
echo "$(date '+%F %T') synced $count scripts" >> /home/hmo/MoFin/gateway/logs/link_sync.log
|
||||
Reference in New Issue
Block a user