Skip to content

Commit

Permalink
fix(setVersionNumber): fix logic error of bump
Browse files Browse the repository at this point in the history
commit bumped `package.json` before tagging
  • Loading branch information
letwebdev committed Feb 25, 2024
1 parent 018065e commit fb62492
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/setVersionNumber.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ if [[ "$1" == "--bump" ]]; then
awk --field-separator=. '/[0-9]+./{$NF++;print}' OFS=.
)"
versionNumberToSet="${versionNumberBumped}"
git tag -a "${versionNumberBumped}" -m "Bump version"
# Substitute version numbers in package.json and commit
sed --in-place --regexp-extended \
"s/\"version\": \".*\"/\"version\": \"${versionNumberToSet/v/}\"/" \
"./package.json"
git add "./package.json"
git commit -m "chore: bump to ${versionNumberToSet}"

git tag -a "${versionNumberToSet}" -m "Bump version"
quantitiesOfExistingVersionNumbers+=1
else
versionNumberToSet="${existingLatestVersionNumber}"
Expand All @@ -39,10 +46,6 @@ else
versionCode="${quantitiesOfExistingVersionNumbers}"
fi

# Substitute version numbers in package.json
sed --in-place --regexp-extended \
"s/\"version\": \".*\"/\"version\": \"${versionNumberToSet/v/}\"/" \
"./package.json"
# Substitute version numbers in gradle build script
ANDROID_PROJECT_DIR="${CAPACITOR_ANDROID_PATH:=./release/android}"
ANDROID_BUILD_SCRIPT="${ANDROID_PROJECT_DIR}/app/build.gradle"
Expand Down

0 comments on commit fb62492

Please sign in to comment.