Skip to content

Commit

Permalink
Removed comments/whitespace from old/new ver determination routine fo…
Browse files Browse the repository at this point in the history
…r compactness ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions]
  • Loading branch information
kudo-sync-bot committed Dec 9, 2024
1 parent f8bb2fa commit 446a622
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions utils/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@ new_versions=() # for dynamic commit msg
for manifest in "${MANIFEST_PATHS[@]}" ; do

# Determine old/new versions
old_ver=$(sed -n 's/.*"version": *"\([0-9.]*\)".*/\1/p' "$manifest")
if [[ $old_ver == "$TODAY" ]] # exact match for $TODAY
then # bump to $TODAY.1
new_ver="$TODAY.1"
elif [[ $old_ver == "$TODAY."* ]] # partial match for $TODAY
then # bump to $TODAY.n+1
LAST_NUMBER=$(echo "$old_ver" | awk -F '.' '{print $NF}')
new_ver="$TODAY.$((LAST_NUMBER + 1))"
else # no match for $TODAY
# bump to $TODAY
new_ver="$TODAY"
old_ver=$(sed -n 's/.*"version": *"\([0-9.]*\)".*/\1/p' "$manifest_path")
if [[ $old_ver == "$TODAY" ]] ; then
new_ver="$TODAY.1"
elif [[ $old_ver == "$TODAY."* ]] ; then
LAST_NUMBER=$(echo "$old_ver" | awk -F '.' '{print $NF}')
new_ver="$TODAY.$((LAST_NUMBER + 1))"
else
new_ver="$TODAY"
fi
new_versions+=("$new_ver")

Expand Down

0 comments on commit 446a622

Please sign in to comment.