From 3735fab2cf684675914355c22599ffb8b944045d Mon Sep 17 00:00:00 2001 From: nyyu Date: Tue, 4 Oct 2022 07:26:06 +0200 Subject: [PATCH] remove empty changelog --- sync.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sync.sh b/sync.sh index 0c819d6..d8435bb 100644 --- a/sync.sh +++ b/sync.sh @@ -14,16 +14,19 @@ repo sync -q -c -j 6 --fail-fast --force-sync --no-tags echo -e "# Build $(date '+%Y-%m-%d %H:%M:%S') UTC\n" >>"${changelog}" -tmp=($(repo forall -c 'echo "${REPO_PATH}:$(git rev-parse HEAD)"')) +tmp=($(repo forall -c 'echo "${REPO_PATH}:$(git rev-parse --short HEAD)"')) for i in "${tmp[@]}"; do IFS=: read -r folder commit <<<"${i}" if [[ "${folder}" != lineage/* && "${before[${folder}]}" != "${commit}" ]]; then cd "${folder}" || continue - { - echo "## ${folder}" - git --no-pager log --pretty=format:"- %s" "${before[${folder}]}".."${commit}" - echo - } >>"${changelog}" + log=$(git --no-pager log --pretty=format:"- %s" "${before[${folder}]}".."${commit}") + if [[ $(echo -n "$log" | wc -l) != 0 ]]; then + { + echo "## ${folder} ${before[${folder}]}..${commit}" + echo "$log" + echo + } >>"${changelog}" + fi cd "${TOPDIR}" || continue fi done