chore(tools): add JS dist to gem release

This commit is contained in:
Cotes Chung 2023-03-18 01:33:44 +08:00
parent 471e8c4018
commit 388efb1ae3
No known key found for this signature in database
GPG key ID: 0D9E54843167A808

View file

@ -27,6 +27,9 @@ GEM_SPEC="jekyll-theme-chirpy.gemspec"
NODE_CONFIG="package.json" NODE_CONFIG="package.json"
JS_DIST="assets/js/dist"
BACKUP_PATH="$(mktemp -d)"
FILES=( FILES=(
"_sass/jekyll-theme-chirpy.scss" "_sass/jekyll-theme-chirpy.scss"
"$GEM_SPEC" "$GEM_SPEC"
@ -150,7 +153,10 @@ build_gem() {
echo -e "Build the gem package for v$_version\n" echo -e "Build the gem package for v$_version\n"
cleanup_config cleanup_config
rm -f ./*.gem rm -f ./*.gem
git add "$JS_DIST" -f # add JS dist to gem
gem build "$GEM_SPEC" gem build "$GEM_SPEC"
cp "$JS_DIST"/* "$BACKUP_PATH"
git restore --staged "$JS_DIST" # resume the git status
resume_config resume_config
} }
@ -202,6 +208,9 @@ main() {
else else
release "$_version" release "$_version"
fi fi
# restore the dist files for future development
mkdir -p "$JS_DIST" && cp "$BACKUP_PATH"/* "$JS_DIST"
} }
while (($#)); do while (($#)); do