整理:灵感日报按年/月/日分层归档 + 生成脚本同步更新
This commit is contained in:
@ -14,20 +14,17 @@ echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting daily digest..." >> "$LOG_FILE"
|
||||
cd "$PROJECT_DIR"
|
||||
python3 analyzers/daily_digest.py >> "$LOG_FILE" 2>&1
|
||||
|
||||
# Git push to Gitea
|
||||
# Git sync: pull rebase first, then always push
|
||||
cd "$PROJECT_DIR"
|
||||
git pull --rebase origin main >> "$LOG_FILE" 2>&1 || echo "WARNING: rebase failed, continuing..." >> "$LOG_FILE"
|
||||
|
||||
# 先拉取远程,避免分支分歧
|
||||
git pull --rebase origin main >> "$LOG_FILE" 2>&1 || true
|
||||
|
||||
# Check if there are changes
|
||||
# Check if anything to commit
|
||||
if [[ -n $(git status --porcelain ai-insights/) ]]; then
|
||||
git add ai-insights/
|
||||
git commit -m "daily digest $(date '+%Y-%m-%d')"
|
||||
git push origin main 2>&1 >> "$LOG_FILE"
|
||||
echo "Pushed to Gitea" >> "$LOG_FILE"
|
||||
else
|
||||
echo "No changes to push" >> "$LOG_FILE"
|
||||
fi
|
||||
|
||||
# Always push (covers both new commits and rebased pending commits)
|
||||
git push origin main >> "$LOG_FILE" 2>&1 && echo "Pushed to Gitea successfully" >> "$LOG_FILE" || echo "WARNING: push failed" >> "$LOG_FILE"
|
||||
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Daily digest done." >> "$LOG_FILE"
|
||||
|
||||
Reference in New Issue
Block a user