From c1e480004acaaa41115468f4b50678ca078dd9e1 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Fri, 3 Jan 2025 17:56:20 +0800 Subject: [PATCH] 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. --- main.sh | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/main.sh b/main.sh index 2c8f3f2..f843183 100644 --- a/main.sh +++ b/main.sh @@ -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