File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ manifest="chromium/extension/manifest.json"
1414
1515# BUMP version
1616echo -e " ${BY} \nBumping version in ${manifest} ...${NC} \n"
17+ bumped_cnt=0
1718TODAY=$( date +' %Y.%-m.%-d' ) # YYYY.M.D format
1819new_versions=() # for dynamic commit msg
1920old_ver=$( sed -n ' s/.*"version": *"\([0-9.]*\)".*/\1/p' " $manifest " )
@@ -26,11 +27,15 @@ else new_ver="$TODAY" ; fi
2627new_versions+=(" $new_ver " )
2728sed -i " s/\" version\" : \" $old_ver \" /\" version\" : \" $NEW_VER \" /" " $manifest "
2829echo -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
You can’t perform that action at this time.
0 commit comments