<commit_before>#!/usr/bin/env bash
#
# 1. Bump latest version number to files:
#   - _sass/jekyll-theme-chirpy.scss
#   - assets/js/.copyright.js
#   - assets/js/dist/*.js (will be built by gulp later)
#   - jekyll-theme-chirpy.gemspec
#   - Gemfile.lock
#   - package.json
#
# 2. Create a git-tag on release branch
#
# 3. Build a RubyGems package base on the latest git-tag
#
#
# Requires: Git, Gulp, RubyGems

set -eu

manual_release=false

ASSETS=(
  "_sass/jekyll-theme-chirpy.scss"
  "assets/js/_copyright"
)

GEM_SPEC="jekyll-theme-chirpy.gemspec"

NODE_META="package.json"

_check_src() {
  if [[ ! -f $1 && ! -d $1 ]]; then
    echo -e "Error: Missing file \"$1\"!\n"
    exit -1
  fi
}

check() {
  if [[ -n $(git status . -s) ]]; then
    echo "Error: Commit unstaged files first, and then run this tool againt."
    exit -1
  fi

  # ensure the current branch is 'master'
  if [[ "$(git branch --show-current)" != "master" && manual_release == "false" ]]; then
    echo "Error: This operation must be performed on the 'master' branch!"
    exit -1
  fi

  for i in "${!ASSETS[@]}"; do
    _check_src "${ASSETS[$i]}"
  done

  _check_src "$NODE_META"
  _check_src "$GEM_SPEC"
}

_bump_assets() {<commit_msg>Fix bump tool<commit_after>#!/usr/bin/env bash
#
# How does it work:
#
#   1. Bump latest version number to files:
#     - _sass/jekyll-theme-chirpy.scss
#     - assets/js/_copyright.js
#     - assets/js/dist/*.js (will be built by gulp later)
#     - jekyll-theme-chirpy.gemspec
#     - package.json
#
#   2. Create a git-tag on release branch
#
#   3. Build a RubyGems package base on the latest git-tag
#
#
# Usage:
#
#   Switch to 'master' branch or 'X-Y-stable' branch with argument '-m',
#`  and then run this script.
#
#
# Requires: Git, Gulp, RubyGems

set -eu

manual_release=false

ASSETS=(
  "_sass/jekyll-theme-chirpy.scss"
  "assets/js/_copyright"
)

GEM_SPEC="jekyll-theme-chirpy.gemspec"

NODE_META="package.json"

_check_src() {
  if [[ ! -f $1 && ! -d $1 ]]; then
    echo -e "Error: Missing file \"$1\"!\n"
    exit -1
  fi
}

check() {
  if [[ -n $(git status . -s) ]]; then
    echo "Error: Commit unstaged files first, and then run this tool againt."
    exit -1
  fi

  # ensure the current branch is 'master' or running in 'manual' mode
  if [[ "$(git branch --show-current)" != "master" && $manual_release == "false" ]]; then
    echo "Error: This operation must be performed on the 'master' branch or '--manual' mode!"
    exit -1
  fi

  for i in "${!ASSETS[@]}"; do
    _check_src "${ASSETS[$i]}"
  done

  _check_src "$NODE_META"
  _check_src "$GEM_SPEC"
}

_bump_assets() {
{'fraction_non_alphanumeric': 0.15693012600229095, 'fraction_numerical': 0.006872852233676976, 'mean_word_length': 2.9457831325301207, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2041576', 'n_tokens_mistral': 1035, 'n_tokens_neox': 1001, 'n_words': 287}