Skip to content

Commit

Permalink
Remove the value of img_cdn and avatar from the gem package
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Oct 14, 2021
1 parent 3d6304e commit 565ad92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down

0 comments on commit 565ad92

Please sign in to comment.