From 739f18c763547a324dd9b649a786f0ea932f67b5 Mon Sep 17 00:00:00 2001 From: kudo-sync-bot Date: Sun, 22 Dec 2024 22:11:56 -0800 Subject: [PATCH] =?UTF-8?q?Condensed=20+=20eliminated=20nesting=20in=20com?= =?UTF-8?q?mit/push=20routine=20=E2=86=9E=20[auto-sync=20from=20https://gi?= =?UTF-8?q?thub.com/adamlui/ai-web-extensions]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/bump.sh | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/utils/bump.sh b/utils/bump.sh index e94ac7b..762e3b2 100644 --- a/utils/bump.sh +++ b/utils/bump.sh @@ -70,19 +70,13 @@ for manifest_path in "${MANIFEST_PATHS[@]}" ; do done # COMMIT/PUSH bump(s) -if (( $bumped_cnt == 0 )) ; then echo -e "${BW}Completed. No manifests bumped.${NC}" -else - plural_suffix=$((( $bumped_cnt > 1 )) && echo "s") - echo -e "\n${BG}${bumped_cnt} manifest${plural_suffix} bumped!${NC}" - echo -e "\n${BY}Committing bump${plural_suffix} to Git...${NC}" - - # Define commit msg - COMMIT_MSG="Bumped \`version\`" - unique_versions=($(printf "%s\n" "${new_versions[@]}" | sort -u)) - if (( ${#unique_versions[@]} == 1 )) ; then COMMIT_MSG+=" to \`${unique_versions[0]}\`" ; fi - - # Commit/push bump(s) - git add ./**/manifest.json && git commit -n -m "$COMMIT_MSG" - git push - echo -e "\n${BG}Success! ${bumped_cnt} manifest${plural_suffix} updated/committed/pushed to GitHub${NC}" -fi +if (( $bumped_cnt == 0 )) ; then echo -e "${BW}Completed. No manifests bumped.${NC}" ; exit 0 ; fi +plural_suffix=$((( $bumped_cnt > 1 )) && echo "s") +echo -e "${BG}${bumped_cnt} manifest${plural_suffix} bumped!\n${NC}" +echo -e "${BY}Committing bump${plural_suffix} to Git...\n${NC}" +COMMIT_MSG="Bumped \`version\`" +unique_versions=($(printf "%s\n" "${new_versions[@]}" | sort -u)) +if (( ${#unique_versions[@]} == 1 )) ; then COMMIT_MSG+=" to \`${unique_versions[0]}\`" ; fi +git add ./**/manifest.json && git commit -n -m "$COMMIT_MSG" +git push +echo -e "\n${BG}Success! ${bumped_cnt} manifest${plural_suffix} updated/committed/pushed to GitHub${NC}"