<commit_before>#!/usr/bin/env bash

# always immediately exit upon error
set -e

# start in project root
cd "`dirname $0`/.."

./bin/require-clean-working-tree.sh

read -p "Enter the version you want to publish, with no 'v' (for example '1.0.1'): " version
if [[ ! "$version" ]]
then
  echo "Aborting."
  exit 1
fi

# push the current branch (assumes tracking is set up) and the tag
git push --recurse-submodules=on-demand
git push origin "v$version"

success=0

# save reference to current branch
current_branch=$(git symbolic-ref --quiet --short HEAD)

# temporarily checkout the tag's commit, publish to NPM
echo
echo 'NOTE!!! publishing with "alpha" tag (whereas default is "latest")'
echo
git checkout --quiet "v$version"
if npm publish --tag alpha
then
  success=1<commit_msg>build param for version scope<commit_after>#!/usr/bin/env bash

# always immediately exit upon error
set -e

# start in project root
cd "`dirname $0`/.."

./bin/require-clean-working-tree.sh

read -p "Enter the version you want to publish, with no 'v' (for example '1.0.1'): " version
if [[ ! "$version" ]]
then
  echo "Aborting."
  exit 1
fi

read -p "Enter a version scope (latest/beta/alpha): " scope
if [[ "$scope" != "latest" ]] && [[ "$scope" != "beta" ]] && [[ "$scope" != "alpha" ]]
then
  echo "Invalid scope '$scope'. Aborting."
  exit 1
fi

# push the current branch (assumes tracking is set up) and the tag
git push --recurse-submodules=on-demand
git push origin "v$version"

success=0

# save reference to current branch
current_branch=$(git symbolic-ref --quiet --short HEAD)

# temporarily checkout the tag's commit, publish to NPM
git checkout --quiet "v$version"
if npm publish --tag "$scope"
then
  success=1
{'fraction_non_alphanumeric': 0.1358313817330211, 'fraction_numerical': 0.008782201405152224, 'mean_word_length': 3.896848137535817, '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': '6777018', 'n_tokens_mistral': 577, 'n_tokens_neox': 543, 'n_words': 219}