@@ -25,7 +25,7 @@ MANIFEST_PATH="chromium/extension/manifest.json"
2525echo -e " ${BY} \nBumping version in ${MANIFEST_PATH} ...${NC} \n"
2626
2727# Init BUMP vars
28- bumped_manifests=() # for final summary
28+ declare -A bumped_manifests=()
2929TODAY=$( date +' %Y.%-m.%-d' ) # YYYY.M.D format
3030
3131# Check LATEST COMMIT for extension changes
@@ -50,28 +50,36 @@ else new_ver="$TODAY" ; fi
5050# BUMP old version
5151sed -i " s/\" version\" : \" $old_ver \" /\" version\" : \" $new_ver \" /" " $MANIFEST_PATH "
5252echo -e " Updated: ${BW} v${old_ver}${NC} → ${BG} v${new_ver}${NC} \n"
53- bumped_manifests+=(" $platform_manifest_path /manifest.json" )
53+ bumped_manifests[" $platform_manifest_path /manifest.json" ]=" $old_ver ;$new_ver "
54+
55+ # LOG manifests bumped
5456if (( ${# bumped_manifests[@]} == 0 )) ; then echo -e " ${BW} Completed. No manifests bumped.${NC} " ; exit 0
55- else echo -e " ${BG}${# bumped_manifests[@]} manifest${plural_suffix} bumped!\n ${NC} " ; fi
57+ else echo -e " ${BG}${# bumped_manifests[@]} manifest${plural_suffix} bumped!${NC} " ; fi
5658
5759# ADD/COMMIT/PUSH bump(s)
5860if [[ " $no_commit " != true ]] ; then
5961 plural_suffix=$(( ( ${# bumped_manifests[@]} > 1 )) && echo " s" )
60- echo -e " ${BY} Committing bump${plural_suffix} to Git...\n${NC} "
61- COMMIT_MSG=" Bumped \` version\` "
62- unique_versions=($( printf " %s\n" " ${new_versions[@]} " | sort -u) )
63- if (( ${# unique_versions[@]} == 1 )) ; then COMMIT_MSG+=" to \` ${unique_versions[0]} \` " ; fi
62+ echo -e " \n${BY} Committing bump${plural_suffix} to Git...\n${NC} "
63+
64+ # Init commit msg
65+ COMMIT_MSG=" Bumped \` version\` to \` $new_ver \` " ; fi
66+
67+ # git add/commit/push
6468 git add ./** /manifest.json && git commit -n -m " $COMMIT_MSG "
6569 if [[ " $no_push " != true ]] ; then
6670 echo -e " \n${BY} Pulling latest changes from remote to sync local repository...${NC} \n"
6771 git pull || (echo -e " ${BR} Merge failed, please resolve conflicts!${NC} " && exit 1)
6872 echo -e " \n${BY} Pushing bump${plural_suffix} to Git...\n${NC} "
6973 git push
7074 fi
75+
7176 git_action=" updated" $( [[ " $no_commit " != true ]] && echo -n " /committed" ) $(
72- [[ " $no_push " != true ]] && echo -n " /pushed" )
77+ [[ " $no_push " != true ]] && echo -n " /pushed" )
7378 echo -e " \n${BG} Success! ${# bumped_manifests[@]} manifest${plural_suffix} ${git_action} to GitHub${NC} "
7479fi
7580
7681# Final SUMMARY log
77- for manifest in " ${bumped_manifests[@]} " ; do echo -e " ± $manifest " ; done # log manifests bumped
82+ for manifest in " ${! bumped_manifests[@]} " ; do
83+ IFS=" ;" read -r old_ver new_ver <<< " ${bumped_manifests[$manifest]}"
84+ echo -e " ± $manifest ${BW} v${old_ver}${NC} → ${BG} v${new_ver}${NC} "
85+ done
0 commit comments