Skip to content

Commit edd3e97

Browse files
committed
Added echo if no manifests bumped ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions]
1 parent 78f3962 commit edd3e97

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

utils/bump.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ manifest="chromium/extension/manifest.json"
1414

1515
# BUMP version
1616
echo -e "${BY}\nBumping version in ${manifest}...${NC}\n"
17+
bumped_cnt=0
1718
TODAY=$(date +'%Y.%-m.%-d') # YYYY.M.D format
1819
new_versions=() # for dynamic commit msg
1920
old_ver=$(sed -n 's/.*"version": *"\([0-9.]*\)".*/\1/p' "$manifest")
@@ -26,11 +27,15 @@ else new_ver="$TODAY" ; fi
2627
new_versions+=("$new_ver")
2728
sed -i "s/\"version\": \"$old_ver\"/\"version\": \"$NEW_VER\"/" "$manifest"
2829
echo -e "Updated: ${BW}v${old_ver}${NC}${BG}v${NEW_VER}${NC}"
30+
((bumped_cnt++))
2931

30-
# COMMIT/PUSH bump(s)
31-
echo -e "${BY}\nCommitting bump to Git...\n${NC}"
32-
git add ./**/manifest.json && git commit -n -m "Bumped \`version\` to $NEW_VER"
33-
git push
32+
# COMMIT/PUSH bump
33+
if [[ $bumped_cnt -eq 0 ]] ; then echo -e "${BW}Completed. No manifests bumped.${NC}"
34+
else
35+
echo -e "\n${BY}\nCommitting bump to Git...\n${NC}"
36+
git add ./**/manifest.json && git commit -n -m "Bumped \`version\` to $NEW_VER"
37+
git push
3438

35-
# Print FINAL summary
36-
echo -e "\n${BG}Success! ${manifest} updated/committed/pushed to GitHub${NC}"
39+
# Print FINAL summary
40+
echo -e "\n${BG}Success! ${manifest} updated/committed/pushed to GitHub${NC}"
41+
fi

0 commit comments

Comments
 (0)