Skip to content

Commit 371c87b

Browse files
committed
remind user to update version field in package.json
1 parent a28b58b commit 371c87b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

script/release

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ OFF='\033[0m'
3131
BOLD_RED='\033[1;31m'
3232
BOLD_GREEN='\033[1;32m'
3333
BOLD_BLUE='\033[1;34m'
34+
BOLD_PURPLE='\033[1;35m'
35+
BOLD_UNDERLINED='\033[1;4m'
3436

3537
# Get the latest release tag
3638
if ! latest_tag=$(git describe --abbrev=0 --match="$tag_glob"); then
@@ -54,6 +56,16 @@ else
5456
exit 1
5557
fi
5658

59+
# Remind user to update the version field in package.json
60+
echo -e -n "Make sure the version field in package.json is ${BOLD_BLUE}$new_tag${OFF}. Yes? [Y/${BOLD_UNDERLINED}n${OFF}] "
61+
read -r YN
62+
63+
if [[ ! ($YN == "y" || $YN == "Y") ]]; then
64+
# Package.json version field is not up to date
65+
echo -e "Please update the package.json version to ${BOLD_PURPLE}$new_tag${OFF} and commit your changes"
66+
exit 1
67+
fi
68+
5769
# Tag the new release
5870
git tag -a "$new_tag" -m "$new_tag Release"
5971
echo -e "${BOLD_GREEN}Tagged: $new_tag${OFF}"

0 commit comments

Comments
 (0)