From a71659ed270440a0fb224144cbbcbdb8d7101530 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Mon, 12 Apr 2021 13:15:14 +0800 Subject: [PATCH] Fix bump tool --- tools/bump.sh | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/tools/bump.sh b/tools/bump.sh index 18b09d8..e71f7ad 100755 --- a/tools/bump.sh +++ b/tools/bump.sh @@ -1,16 +1,23 @@ #!/usr/bin/env bash # -# 1. Bump latest version number to files: -# - _sass/jekyll-theme-chirpy.scss -# - assets/js/.copyright.js -# - assets/js/dist/*.js (will be built by gulp later) -# - jekyll-theme-chirpy.gemspec -# - Gemfile.lock -# - package.json +# How does it work: # -# 2. Create a git-tag on release branch +# 1. Bump latest version number to files: +# - _sass/jekyll-theme-chirpy.scss +# - assets/js/_copyright.js +# - assets/js/dist/*.js (will be built by gulp later) +# - jekyll-theme-chirpy.gemspec +# - package.json # -# 3. Build a RubyGems package base on the latest git-tag +# 2. Create a git-tag on release branch +# +# 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 @@ -41,9 +48,9 @@ check() { exit -1 fi - # ensure the current branch is 'master' - if [[ "$(git branch --show-current)" != "master" && manual_release == "false" ]]; then - echo "Error: This operation must be performed on the 'master' branch!" + # ensure the current branch is 'master' or running in 'manual' mode + if [[ "$(git branch --show-current)" != "master" && $manual_release == "false" ]]; then + echo "Error: This operation must be performed on the 'master' branch or '--manual' mode!" exit -1 fi