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

set -e

source $(dirname $0)/helpers.sh

RELEASE_TYPE=$1

usage() {
  echo "$(basename $0) (major | minor | patch)"
}

if hasChanges; then
  echo "error: there are uncommitted changes"
  exit 1
fi

case "$RELEASE_TYPE" in
  major|minor|patch)
    ;;

  -h|--help)
    usage
    exit 0
    ;;

  *)
    usage
    exit 1
    ;;
esac

npm test
mversion $RELEASE_TYPE -m
git push
git push --tags
npm publish
$(dirname $0)/update-gh-pages.sh<commit_msg>Add support for doing dev releases via the release script.<commit_after>#!/usr/bin/env bash

set -e

source $(dirname $0)/helpers.sh

RELEASE_TYPE=
TAG=

usage() {
  echo "$(basename $0) (major | minor | patch) (--latest|--dev)"
}

if hasChanges; then
  echo "error: there are uncommitted changes"
  exit 1
fi

while [ -n "$1" ]; do
  case "$1" in
    major|minor|patch)
      RELEASE_TYPE=$1
      ;;

    -h|--help)
      usage
      exit 0
      ;;

    --latest)
      TAG=latest
      ;;

    --dev)
      TAG=dev
      ;;

    *)
      usage
      exit 1
      ;;
  esac
  shift
done

if [[ -z "$RELEASE_TYPE" || -z "$TAG" ]]; then
  usage
  exit 1
fi

npm test
mversion $RELEASE_TYPE -m
git push
git push --tags
npm publish --tag=$TAG
if [ "$TAG" == "latest" ]; then
  $(dirname $0)/update-gh-pages.sh
fi
{'fraction_non_alphanumeric': 0.14671814671814673, 'fraction_numerical': 0.013127413127413128, 'mean_word_length': 2.3575129533678756, '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': '7613804', 'n_tokens_mistral': 515, 'n_tokens_neox': 474, 'n_words': 143}