From c1b20d8f71b91b41ccaefdda51bdc636e0f99830 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 27 Jan 2021 03:17:00 +0800 Subject: [PATCH] Fix bump tool --- tools/bump.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/bump.sh b/tools/bump.sh index 9c6c5b2..4285cfe 100755 --- a/tools/bump.sh +++ b/tools/bump.sh @@ -17,6 +17,8 @@ ASSETS=( GEM_SPEC="jekyll-theme-chirpy.gemspec" +NODE_META="package.json" + bump_assets() { _version="$1" for i in ${!ASSETS[@]}; do @@ -27,13 +29,19 @@ bump_assets() { } bump_gemspec() { - _version="$1" - sed -i "s/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/$_version/" $GEM_SPEC + sed -i "s/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/$1/" $GEM_SPEC +} + +bump_node() { + sed -i \ + "s,[\"]version[\"]: [\"][[:digit:]]\.[[:digit:]]\.[[:digit:]][\"],\"version\": \"$1\"," \ + $NODE_META } bump() { bump_assets $1 bump_gemspec $1 + bump_node $1 if [[ -n $(git status . -s) ]]; then git add .