Fix bump tool

This commit is contained in:
Cotes Chung 2021-04-12 13:15:14 +08:00
parent b14e97a92d
commit a71659ed27

View file

@ -1,11 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# How does it work:
#
# 1. Bump latest version number to files: # 1. Bump latest version number to files:
# - _sass/jekyll-theme-chirpy.scss # - _sass/jekyll-theme-chirpy.scss
# - assets/js/.copyright.js # - assets/js/_copyright.js
# - assets/js/dist/*.js (will be built by gulp later) # - assets/js/dist/*.js (will be built by gulp later)
# - jekyll-theme-chirpy.gemspec # - jekyll-theme-chirpy.gemspec
# - Gemfile.lock
# - package.json # - package.json
# #
# 2. Create a git-tag on release branch # 2. Create a git-tag on release branch
@ -13,6 +14,12 @@
# 3. Build a RubyGems package base on the latest git-tag # 3. Build a RubyGems package base on the latest git-tag
# #
# #
# Usage:
#
# Switch to 'master' branch or 'X-Y-stable' branch with argument '-m',
#` and then run this script.
#
#
# Requires: Git, Gulp, RubyGems # Requires: Git, Gulp, RubyGems
set -eu set -eu
@ -41,9 +48,9 @@ check() {
exit -1 exit -1
fi fi
# ensure the current branch is 'master' # ensure the current branch is 'master' or running in 'manual' mode
if [[ "$(git branch --show-current)" != "master" && manual_release == "false" ]]; then if [[ "$(git branch --show-current)" != "master" && $manual_release == "false" ]]; then
echo "Error: This operation must be performed on the 'master' branch!" echo "Error: This operation must be performed on the 'master' branch or '--manual' mode!"
exit -1 exit -1
fi fi