From 388efb1ae3ee3eefa953b29ef7227951d8fc794f Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 18 Mar 2023 01:33:44 +0800 Subject: [PATCH] chore(tools): add JS dist to gem release --- tools/release | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/release b/tools/release index 8efb264..48bff39 100755 --- a/tools/release +++ b/tools/release @@ -27,6 +27,9 @@ GEM_SPEC="jekyll-theme-chirpy.gemspec" NODE_CONFIG="package.json" +JS_DIST="assets/js/dist" +BACKUP_PATH="$(mktemp -d)" + FILES=( "_sass/jekyll-theme-chirpy.scss" "$GEM_SPEC" @@ -150,7 +153,10 @@ build_gem() { echo -e "Build the gem package for v$_version\n" cleanup_config rm -f ./*.gem + git add "$JS_DIST" -f # add JS dist to gem gem build "$GEM_SPEC" + cp "$JS_DIST"/* "$BACKUP_PATH" + git restore --staged "$JS_DIST" # resume the git status resume_config } @@ -202,6 +208,9 @@ main() { else release "$_version" fi + + # restore the dist files for future development + mkdir -p "$JS_DIST" && cp "$BACKUP_PATH"/* "$JS_DIST" } while (($#)); do