@@ -128,6 +128,7 @@ init_value() {
128128 SOURCE_DIR=$( dirname $( safe_readlink $0 ) )
129129 if [ -f ${SOURCE_DIR} /Script/common.sh ]; then
130130 source ${SOURCE_DIR} /Script/common.sh
131+ check_echo_color_with_tput
131132 check_git
132133 fi
133134
@@ -319,9 +320,9 @@ parse_with_getopts() {
319320 # 参数验证
320321 if [ -n " $VERSION " ]; then
321322 if [[ ! " $VERSION " =~ ^${VERSION_PATTERN} $ ]]; then
322- echo " X Invalid SemVer format: $VERSION " >&2
323- echo " Expected format: [v]X.Y.Z[-prerelease][+build]" >&2
324- echo " See: https://semver.org/" >&2
323+ echo_error " X Invalid SemVer format: $VERSION " >&2
324+ echo_error " Expected format: [v]X.Y.Z[-prerelease][+build]" >&2
325+ echo_error " See: https://semver.org/" >&2
325326 exit 1
326327 fi
327328 fi
@@ -343,6 +344,22 @@ parse_with_getopts() {
343344 DATE_TIME_UTC=$( date -u +" %Y-%m-%d %H:%M:%S (UTC)" )
344345}
345346
347+ check_chang_log () {
348+ echo " ? Modified change log?"
349+ local content=$( < ${SOURCE_DIR} /Changelog.md)
350+ if [[ $content =~ $VERSION ]]; then
351+ echo_success " √ Modified in \" Changelog.md\" "
352+ else
353+ echo_warn " ! Warning: Don't include \" $VERSION \" in the file \" Changelog.md\" "
354+ fi
355+ content=$( < ${SOURCE_DIR} /Changelog_zh_CN.md)
356+ if [[ $content =~ $VERSION ]]; then
357+ echo_success " √ Modified change log in \" Changelog_zh_CN.md\" "
358+ else
359+ echo_warn " ! Warning: Don't include \" $VERSION \" in the file \" Changelog_zh_CN.md\" "
360+ fi
361+ }
362+
346363create_tag () {
347364 if [ " $DEPLOY " = " ON" ]; then
348365 # PRE_TAG=`git tag --sort=-taggerdate | head -n 1`
@@ -352,13 +369,14 @@ create_tag() {
352369 echo " Message: $MESSAGE "
353370 echo " "
354371 echo " Please verify:"
355- echo " √ Modify change log?"
356- echo " √ Translations updated?"
372+ echo " ? Modify change log?"
373+ check_chang_log
374+ echo " ? Translations updated?"
357375 echo " "
358376
359- read -t 30 -p " ? Deploy? (y/N): " INPUT
377+ read -t 60 -p " ? Deploy? (y/N): " INPUT
360378 if [ " ${INPUT:- N} " != " Y" ] && [ " ${INPUT:- N} " != " y" ]; then
361- echo " X Deployment cancelled"
379+ echo_error " X Deployment cancelled"
362380 exit 0
363381 fi
364382
@@ -368,14 +386,14 @@ create_tag() {
368386 if git rev-parse " $VERSION " > /dev/null 2>&1 ; then
369387 echo " = Tag $VERSION already exists, deleting ......"
370388 git tag -d " $VERSION "
371- echo " √ Successfully delete tag $VERSION "
389+ echo_success " √ Successfully delete tag $VERSION "
372390 echo " "
373391 fi
374392
375393 # Create new tag
376394 echo " = Creating tag: $VERSION ......"
377395 git tag -a " $VERSION " -m " ${MESSAGE} "
378- echo " √ Tag created: $VERSION "
396+ echo_success " √ Tag created: $VERSION "
379397 echo " "
380398 fi
381399}
@@ -387,9 +405,9 @@ commit_code() {
387405 # Commit if there are changes
388406 if ! git diff --cached --quiet; then
389407 git commit -m " $MESSAGE "
390- echo " √ Changes committed"
408+ echo_success " √ Changes committed"
391409 else
392- echo " X No changes to commit"
410+ echo_error " X No changes to commit"
393411 exit 1
394412 fi
395413}
@@ -408,7 +426,7 @@ push_remote_repository() {
408426 git push origin HEAD
409427 git push origin " $VERSION "
410428
411- echo " √ Push to remote repository successfully!"
429+ echo_success " √ Push to remote repository successfully!"
412430 fi
413431}
414432
@@ -426,7 +444,7 @@ echo "= Update version to $VERSION ......"
426444
427445update_verion
428446
429- echo " √ Version updated to $VERSION successfully!"
447+ echo_success " √ Version updated to $VERSION successfully!"
430448# echo " Time: $DATE_TIME_UTC"
431449echo " "
432450
0 commit comments