From 565ad9229c334709601fe15b80bf9dcf246128eb Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sun, 3 Oct 2021 18:39:00 +0800 Subject: [PATCH] Remove the value of `img_cdn` and `avatar` from the gem package --- tools/init.sh | 2 +- tools/release.sh | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/init.sh b/tools/init.sh index ab90a61..f6d6a4a 100755 --- a/tools/init.sh +++ b/tools/init.sh @@ -69,7 +69,7 @@ init_files() { rm -f "$_workflow.$TEMP_SUFFIX" ## Cleanup image settings in site config - sed -i.$TEMP_SUFFIX "s/^img_cdn:.*/img_cdn: ''/;s/^avatar:.*/avatar: ''/" _config.yml + sed -i.$TEMP_SUFFIX "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml rm -f _config.yml.$TEMP_SUFFIX fi diff --git a/tools/release.sh b/tools/release.sh index ef5892b..00a363a 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -28,6 +28,16 @@ check() { fi } +## Remove unnecessary theme settings +cleanup_config() { + cp _config.yml _config.yml.bak + sed -i "s/^img_cdn:.*/img_cdn:/;s/^avatar:.*/avatar:/" _config.yml +} + +resume_config() { + mv _config.yml.bak _config.yml +} + release() { _default_branch="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')" _version="$(grep "spec.version" jekyll-theme-chirpy.gemspec | sed 's/.*= "//;s/".*//')" # X.Y.Z @@ -49,9 +59,10 @@ release() { # build a gem package echo -e "Build the gem pakcage for v$_version\n" + cleanup_config rm -f ./*.gem gem build "$GEM_SPEC" - + resume_config } main() {