style: format output for synchronization report

- Adjust formatting of the synchronization report output
- Change indentation and bullet points for better readability
- Ensure consistent presentation of start time, end time, and status

These changes improve the clarity and presentation of the synchronization
report, making it easier for users to read and understand the
synchronization statistics and details.
This commit is contained in:
songtianlun 2025-01-03 17:56:20 +08:00
parent 54abd6106f
commit c1e480004a

39
main.sh
View File

@ -65,28 +65,33 @@ $(cat "${LOG_FILE}")"
stats=$(cat "$STATS_FILE")
summary="GitHub to Gitea 同步报告
开始时间: $(echo "$stats" | jq -r '.start_time')
结束时间: $(echo "$stats" | jq -r '.end_time')
同步状态: $([ $mirror_exit_code -eq 0 ] && echo "成功" || echo "失败")
开始时间: $(echo "$stats" | jq -r '.start_time')
结束时间: $(echo "$stats" | jq -r '.end_time')
同步状态: $([ $mirror_exit_code -eq 0 ] && echo "成功" || echo "失败")
统计信息:
- 总仓库数: $(echo "$stats" | jq -r '.total_repos')
- 处理数量: $(echo "$stats" | jq -r '.processed')
- 成功数量: $(echo "$stats" | jq -r '.success')
- 失败数量: $(echo "$stats" | jq -r '.failed')
- 跳过数量: $(echo "$stats" | jq -r '.skipped')
统计信息:
- 总仓库数: $(echo "$stats" | jq -r '.total_repos')
- 处理数量: $(echo "$stats" | jq -r '.processed')
- 成功数量: $(echo "$stats" | jq -r '.success')
- 失败数量: $(echo "$stats" | jq -r '.failed')
- 跳过数量: $(echo "$stats" | jq -r '.skipped')
跳过的仓库:
$(echo "$stats" | jq -r '.details.skipped_repos[]' | sed 's/^/- /')
跳过的仓库:
$(echo "$stats" | jq -r '.details.skipped_repos[]' | sed 's/^/- /')
失败的仓库:
$(echo "$stats" | jq -r '.details.failed_repos[]' | sed 's/^/- /')
失败的仓库:
$(echo "$stats" | jq -r '.details.failed_repos[]' | sed 's/^/- /')
成功的仓库:
$(echo "$stats" | jq -r '.details.success_repos[]' | sed 's/^/- /')
成功的仓库:
$(echo "$stats" | jq -r '.details.success_repos[]' | sed 's/^/- /')
详细日志 (最后 50):
$(tail -n 50 "$LOG_FILE")
详细日志:
$(cat "$LOG_FILE")
"
详细日志 (最后 50):
$(tail -n 50 "$LOG_FILE")"
else
summary="无法获取同步统计信息"
fi